Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

CSS Examples: width

Examples

Width measured in px

Width in percentage

What happens when the browser decides

Styles Used

.length {
	width: 200px;
	background-color: red;
	border: 1px solid black;
}
.percent {
	width: 20%;
	background-color: silver;
	border: 1px solid red;
}
.auto {
	width: auto;
	background-color: yellow;
	border: 1px solid blue;
}