Here are some examples of how I use this property in my projects: (1) Violently clear floating Copy code The code is as follows:<style type="text/css"> .wrap {overflow: hidden;zoom:1;background-color: #ccc;} .wrap p {float: left;} </style> Copy code The code is as follows:<div class="wrap"> <p>test of css</p> </div> (2) Prevent margins from collapsing Copy code The code is as follows:<style type="text/css"> body,p {padding: 0;margin: 0;} .wrap {overflow: hidden;zoom:1;background-color: #ccc;} .wrap p {margin-top: 20px;} </style> <div class="wrap"> <p>test of css</p> </div> (3) In IE-6, solve the problem of defining 1px high block elements Copy code The code is as follows:<style type="text/css"> .line {height: 1px;background-color: #ccc;overflow: hidden;} </style> <div class="line"></div> (4) Create a two-column layout Copy code The code is as follows:<style type="text/css"> div {height: 500px;} .left {float: left;background-color: #000;width: 200px;margin-right: 5px;} .right {overflow: hidden;zoom:1;background-color: #ccc;} </style> <div class="left"></div> <div class="right"></div> |
<<: Mysql practical exercises simple library management system
>>: Detailed operations of building RabbitMq's common cluster and mirror cluster with Docker
After spending half the night on it, I finally ma...
This article example shares the specific code of ...
Tomcat itself optimization Tomcat Memory Optimiza...
Convert code to image using html2canvas is a very...
Delete the previously installed mariadb 1. Use rp...
Docker view process, memory, cup consumption Star...
Table of contents 1. Error message 2. Cause of er...
Put your own web project in the webapps directory...
CSS Position The position attribute specifies the...
Introduction This article records how to mount a ...
Preface Review and summary of mobile terminal rem...
Technical Background Latex is an indispensable to...
Page Description: Main page: name —> shisheng...
This tutorial shares the process of manually inst...