How to write CSS height syntax?

Last Update: Apr 27 2024 | BY: Nishant Verma

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 Us: advertise@gdatamart.com

Donate Us: Support to GDATAMART

LifeStyle & Fun

© 2024 GDATAMART.COM (All Rights Reserved)