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;
}