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

AI Hentai Generator
Generate AI Hentai for free.

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



The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

The article discusses the <iframe> tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

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