TOP CATEGORIES

×

How to write CSS height syntax?

P

Pyush Ojha

CSS height property is used to set height of an HTML elements like <div>, <p>, etc.

Supposed, I want to write CSS height Syntax for <div> element:

CSS Height Syntax for <div> Element:

div {

  height: 300px;

}

We can apply height property of an elements by using (#) ID and (.) Class selectors for example:

.My_div {

height: 400px;

}

<div class="My_div "> This is my first div with Class selector</div>

****************************************************************************

#My_div {

height: 400px;

}

<div id="My_div "> This is my first div with ID selector</div>

0 votes

Your Answer

Email: advertise@gdatamart.com

Donate: To Support US

© 2024 GDATAMART.COM (All Rights Reserved)