CSS Clear Property

The Web Book

Products

Services (clear:both)

Products

Services (clear:none)


CSS Clear Property Example Code

HTML CODE .......................................... <!DOCTYPE html> <html> <body> <h3>Products</h3> <img class="images" src="product1.jpg"> <img class="images" src="product2.jpg"> <h3 class="services">Services</h3> <img class="images" src="service1.jpg"> <img class="images" src="service2.jpg"> </body> </html> CSS CODE ............................................................. .images {float:left; width:100px; height:140px; margin:5px;} .services {clear:both; margin-bottom:2px;} Setting clear:none yields the second output. Back