css layout ?human?ladder
Div commonly used
absolute: Positioning
relative: relative positioning, absolute matching, relative is usually the concept of the parent
View Code
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-TW" lang="zh-TW"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=big5" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <title>三?式版面</title> 7 <style type="text/css"> 8 #wrapper { 9 width: 100%; /* ?定???度 */10 }11 #header {12 background-color: #DDDDDD;13 height: 50px;14 }15 #container {16 position: relative;17 margin: 10px 0;18 width: 100%;19 }20 #primary {21 margin: 0 200px; /* ?定左右?界155px */22 background-color: #C7D5ED;23 }24 #secondary {25 position: absolute;26 left: 0px;27 top: 0px;28 width: 145px; /* ?定???度 */29 background-color: #F9CFBA;30 }31 #advertisement {32 position: absolute; /* ?配置方式值指定?absolute */33 right: 0px; /* 指定???右?的距? */34 top: 0px; /* 指定???上方的距? */35 width: 145px; /* ?定???度 */36 background-color: #E5C7ED;37 }38 #footer {39 background-color: #DDDDDD;40 height: 50px;41 }42 </style>43 </head>44 45 <body>46 <div id="wrapper">47 <div id="header"><br /></div>48 <div id="container">49 <div id="primary"><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>50 <div id="secondary"><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>51 <div id="advertisement"><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>52 </div>53 <div id="footer"><br /></div>54 </div>55 </body>56 </html>
float: If the div is determined by nature, the following text is text, and the float above the clear below is normal, and the float must be determined. To set the width property
View Code
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-TW" lang="zh-TW"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=big5" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <title>?作涵?其它??的Box</title> 7 <style type="text/css"> 8 #wrapper { 9 width: 760px;10 }11 #header {12 background-color: #DDDDDD;13 height: 50px;14 }15 #container {16 float: left; /* 指定??向左浮? */17 width: 605px; /* 指定???度 */18 }19 #primary {20 float: right; /* 指定??向右浮? */21 width: 450px;22 margin: 10px 0;23 background-color: #C7D5ED;24 }25 #secondary {26 float: left;27 width: 145px;28 margin: 10px 0 10px 0px; /* 只修改上、下?界的值 */29 background-color: #F9CFBA;30 }31 #advertisement {32 float: right;33 width: 145px;34 margin: 10px 0;35 background-color: #E5C7ED;36 }37 #footer {38 clear: both;39 background-color: #DDDDDD;40 height: 50px;41 }42 </style>43 </head>44 45 <body>46 <div id="wrapper">47 <div id="header"><br /></div>48 <div id="container">49 <div id="primary"><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>50 <div id="secondary"><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>51 </div>52 <div id="advertisement"><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>53 <div id="footer"><br /></div>54 </div>55 </body>56 </html>
margin: the gap between the container and the container set width 100% When , the margin is ?, which means that the container has a distance from the following container to the value of the previous container
View Code
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-TW" lang="zh-TW"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=big5" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <title>以??界?作可自??整?度的??</title> 7 <style type="text/css"> 8 #wrapper { 9 width: 100%; /* 修改??的?度?定 */10 }11 #header {12 background-color: #DDDDDD;13 height: 50px;14 }15 #container {16 float: left;17 width: 100%; /* 修改??的?度?定 */18 margin-right: -145px; /* ?定右?界的值??值 */19 }20 #primary {21 float: right;22 width: 100%; /* 修改??的?度?定 */23 margin: 10px 0 10px -145px; /* ?定左?界的值??值 */24 background-color: #C7D5ED;25 }26 #content {27 margin: 0 155px; /* ?定左右?界 */28 background-color: #CAEDC7;29 }30 #secondary {31 float: left;32 width: 145px;33 margin: 10px 0 10px 0px;34 background-color: #F9CFBA;35 }36 #advertisement {37 float: right;38 width: 145px;39 margin: 10px 0;40 background-color: #E5C7ED;41 }42 #footer {43 clear: both;44 background-color: #DDDDDD;45 height: 50px;46 }47 </style>48 </head>49 50 <body>51 <div id="wrapper">52 <div id="header"><br /></div>53 <div id="container">54 <div id="primary">55 <div id="content"><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>56 </div>57 <div id="secondary"><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>58 </div>59 <div id="advertisement"><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>60 <div id="footer"><br /></div>61 </div>62 </body>63 </html>
From: css layout ?人的ladder

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

GiteePages static website deployment failed: 404 error troubleshooting and resolution when using Gitee...

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

To achieve the effect of scattering and enlarging the surrounding images after clicking on the image, many web designs need to achieve an interactive effect: click on a certain image to make the surrounding...

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.

The Y-axis position adaptive algorithm for web annotation function This article will explore how to implement annotation functions similar to Word documents, especially how to deal with the interval between annotations...
