The Selector Selects All Elements
The Selector Selects All Elements
DOCTYPE html>
<html>
<head>
<style>
box-sizing: border-box;
width: 100%;
padding: 12px;
border-radius: 4px;
resize: vertical;
label {
display: inline-block;
input[type=submit] {
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
float: right;
}
input[type=submit]:hover {
background-color: #45a049;
.container {
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px;
.col-25 {
float: left;
width: 25%;
margin-top: 6px;
.col-75 {
float: left;
width: 75%;
margin-top: 6px;
.row:after {
content: "";
display: table;
clear: both;
}
/* Responsive layout - when the screen is less than 600px wide, make the two columns stack on top of
each other instead of next to each other */
width: 100%;
margin-top: 0;
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-25">
</div>
<div class="col-75">
</div>
</div>
<div class="row">
<div class="col-25">
<div class="col-75">
</div>
</div>
<div class="row">
<div class="col-25">
<label for="country">Country</label>
</div>
<div class="col-75">
<option value="australia">Australia</option>
<option value="canada">Canada</option>
<option value="usa">USA</option>
</select>
</div>
</div>
<div class="row">
<div class="col-25">
<label for="subject">Subject</label>
</div>
<div class="col-75">
</div>
</div>
<div class="row">
</form>
</div>
</body>
</html>
The clear property specifies on which sides of an element floating elements are
not allowed to float.
Value Description
both No floating elements allowed on either the left or the right side
The display property specifies the display behavior (the type of rendering box)
of an element.
display: none/inline/block/inline-block