CSS perfect DIV CSS layout_html/css_WEB-ITnose
--Tip: First set the border: solid 1px blue in the CSS style of each larger DIV and then remove it after adjusting the overall layout.
1. Get the outermost frame first
View Code
1 <div id="outterDiv">2 3 </div>
2. Add CSS immediately
View Code
1 <style type="text/css">2 3 #outterDiv{ width:600px; }4 5 </style>
3. Analyze the left and right structure of the layout
View Code
1 <div class="InnerDiv">2 3 </div>4 5 <div class="InnerDiv">6 7 </div>
4. Add CSS
View Code
1 .InnerDiv { width:49%; float:left; overflow:hidden; margin-left:5px; display:inline; }
5. Analyze as left-right-bottom structure
View Code
1 <div class="LeftDiv"> 2 3 </div> 4 5 <div class="RightDiv"> 6 7 </div> 8 9 <div class="DownDiv">10 11 </div>
6. Add CSS
View Code
1 .LeftDiv { width:200px; float:left; margin-left:17px;margin-top:10px; display:inline; }2 .RightDiv { width:40px; float:left; display:inline; margin-left:5px; margin-top:100px; }3 .DownDiv { width:200px; text-align:center;margin-bottom:8px; }
7. The left part is divided into two DIVs, upper and lower DIV
View Code
<div class="NameDiv"></div><div class="SortDiv"></div>
8. Add CSS
View Code
1 .NameDiv { width:100%; }2 .SortDiv { width:100%; }
9. Fill each DIV content
10. All codes
View Code
1 <html xmlns="http://www.w3.org/1999/xhtml"> 2 <head runat="server"> 3 <title>排序管理</title> 4 <style type="text/css"> 5 #outterDiv{ width:600px; } 6 .InnerDiv { width:49%; float:left; overflow:hidden; margin-left:5px; display:inline; } 7 .LeftDiv { width:200px; float:left; margin-left:17px;margin-top:10px; display:inline; } 8 .RightDiv { width:40px; float:left; display:inline; margin-left:5px; margin-top:100px; } 9 .DownDiv { width:200px; text-align:center;margin-bottom:8px; }10 .NameDiv { width:100%; }11 .SortDiv { width:100%; }12 </style>13 </head>14 <body style="font-size:12px;">15 <form id="form1" runat="server">16 <div id="outterDiv">17 <div class="InnerDiv">18 <fieldset>19 <legend>20 <font style='font-size:12px;'>部门管理</font>21 </legend>22 <div class="LeftDiv">23 <div class="NameDiv">24 部门维护:<br />25 <asp:TextBox ID="tbDept" runat="server" Width="200px"></asp:TextBox>26 </div>27 <div class="SortDiv">28 部门排序:<br />29 <asp:ListBox ID="LibDeptOrder" runat="server" Height="250px" Width="200px" AutoPostBack="true"30 onselectedindexchanged="LibDeptOrder_SelectedIndexChanged"></asp:ListBox>31 </div>32 </div>33 <div class="RightDiv">34 <asp:Button ID="btnDeptUp" runat="server" Text="上移" onclick="btnDeptUp_Click" />35 <br />36 <asp:Button ID="btnDeptDown" runat="server" Text="下移" onclick="btnDeptDown_Click" />37 </div>38 <div class="DownDiv">39 <asp:Button ID="btnDeptSave" runat="server" Text="保存" onclick="btnDeptSave_Click" />40 <asp:Button ID="btnDeptDel" runat="server" Text="删除" onclick="btnDeptDel_Click" />41 </div>42 </fieldset>43 </div>44 <div class="InnerDiv">45 <fieldset>46 <legend>47 <font style='font-size:12px;'>职位管理</font>48 </legend>49 <div class="LeftDiv">50 <div class="NameDiv">51 职位维护:<br />52 <asp:TextBox ID="tbPosi" runat="server" Width="200px"></asp:TextBox>53 </div>54 <div class="SortDiv">55 职位排序:<br />56 <asp:ListBox ID="libPosiOrder" runat="server" Height="250px" Width="200px" AutoPostBack="true" 57 onselectedindexchanged="libPosiOrder_SelectedIndexChanged"></asp:ListBox>58 </div>59 </div>60 <div class="RightDiv">61 <asp:Button ID="btnPosiUp" runat="server" Text="上移" onclick="btnPosiUp_Click" />62 <br />63 <asp:Button ID="btnPosiDown" runat="server" Text="下移" onclick="btnPosiDown_Click" />64 </div>65 <div class="DownDiv">66 <asp:Button ID="btnPosiSave" runat="server" Text="保存" onclick="btnPosiSave_Click" />67 <asp:Button ID="btnPosiDel" runat="server" Text="删除" onclick="btnPosiDel_Click" />68 </div>69 </fieldset>70 </div>71 </div>72 <input type="hidden" id="hidUnitID" runat="server"/>73 </form>74 </body>75 </html>

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...
