CSS Width & Height
Next ❯CSS Text
- turned_in_notProperties
- labelWidth Properties
- width
- min-width
- max-width
- labelHeight Properties
- height
- min-height
- max-height
- labelHeight & Width values can be in
- auto - the browser default (Default)
- length - specifies in px, pt, cm, etc
- % - specifies in percent(%)
Checkout the Width
h1 {
width:100%;
background-color:#5ccfcf;
}
widthsubject
widthclose
<!DOCTYPE html>
<html>
<head>
<title>Full CSS Code</title>
<style>
h1 {
width:100%;
background-color:#5ccfcf;
}
</style>
</head>
<body>
<h1 style="text-align: center;">Checkout the Width</h1>
</body>
</html>
- label_outlineTryout Others
Properties Values width:
min-width:
max-width:
min-width
should be less than othersmax-width
limit thewidth
value even it exceeds
Checkout the Height
h1 {
hight:40px;
background-color:#ac5ccf;
}
heightsubject
heightclose
<!DOCTYPE html>
<html>
<head>
<title>Full CSS Code</title>
<style>
h1 {
hight:40px;
background-color:#ac5ccf;
}
</style>
</head>
<body>
<h1 style="text-align: center;">Checkout the Height</h1>
</body>
</html>
- label_outlineTryout Others
Properties Values height:
min-height:
max-height:
min-height
should be less than othersmax-height
limit theheight
value even it exceeds
❮ Prev CSS Padding
Next ❯CSS Text