The road to self-study in PHP-----DIV CSS (Day 4)_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:27:20
Original
893 people have browsed it

Floating in DIV CSS is divided into left floating, right floating and clear floating. 1. Right floating. The so-called right floating means that a block element moves to the right to give up its own space and moves to the right until it encounters Contains the rightmost border of its own parent element. As shown in the figure below:

The test code is as follows:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title> 浮动案例 </title>  <link rel="stylesheet" style="text/css" href="float.css"/> </head> <body>    <div class="div1" id="id1">div1</div>    <div class="div1">div2</div>    <div class="div1">div3</div>   </body></html>
Copy after login
.div1{   width:150px;   height:100px;   border:1px solid red;   background:pink;   margin-top:5px;}/*id 选择器*/#id1{   float:right;}
Copy after login


2.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template