Computer scienceFrontendCSSBasic propertiesPositioning

Images and Text

Application

Report a typo

Use appropriate float values to move the red squares to the left and the blue squares to the right. You can use the clear property of CSS to achieve the below-given result.

The red squares in the left and the blue squares on the right

Write HTML and CSS code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
<div id="container">
<div class="square red">1</div>
<div class="square blue">2</div>
<div class="square red">3</div>
<div class="square blue">4</div>
</div>
</body>
</html>
Completed 1 of 4
The red squares are on the left.
The blue squares are on the right.
___

Create a free account to access the full topic