Div CSS layout is often encountered in the article title list before the number (1-10) layout, how to easily implement such a news article title List layout? If you see a list layout, there are 1 2 3 4 5 6 7 numeric order.
Similar with ordered layout
first, layout thinking explanation-TOP
May encounter such a layout first reaction you would think of an orderly label Ol Li use, but here DIVCSS5 tell you because the browser version is more and different browsers on the ol Li ordered list of the default comes with the list of serial numbers are different display, so easy to cause browser compatibility problems, so encountered such an orderly layout , Shanghai's best sexual function treatment hospital told you, the simplest is to cut the serial number into the background image, CSS layout as a UL or OL background picture to achieve the same layout effect.
But usually we use more than UL, so although there is a sequence of the list of course here also use UL Li to achieve this layout.
Here's how to cut out the image material for easy layout. DIVCSS5 recommended one-time whole cut picture as background image material.
Cut out such a complete vertical bar image as Div+css layout footage, save as saved using
Ii. Instance-specific layout code (HTML+CSS)-TOP
The case code layout is based on the inductive DIVCSS5 initialization template.
1. HTML code
-
- <ul class="Array">
- <li><a href="http://www.divcss5.com/css-texiao/texiao745.shtml">
Continuous scrolling one data at a time div CSS js scrolling effects </a></li>
- <li><a href=" http://www.divcss5.com/wenji/w744.shtml "> parent container box div Height cannot be adaptively resolved </a></ li>
- <li ><a href= "http://www.divcss5.com/wenji/w743.shtml" > why div CSS Web pages cannot be horizontally centered in the FF browser </a>< /li>
- <li><a href=" http://www.divcss5.com/w3c/w742.shtml ">xhtml (DIV&NBSP;CSS) code seven basic specifications </a></ Li>
- <li ><a href= "http://www.divcss5.com/shili/s733.shtml" > left logo right ad picture layout div css Floating Layout Instance </a> </li>
- <li><a href=" http://www.divcss5.com/shili/s731.shtml "> a simple navigation bar for DIV+CSS code layout </a></ li>
- <li ><a href= "http://www.divcss5.com/shili/s730.shtml" >div css absolute positioning layout case position Layout instance </a></ li>
- <li><a href="http://www.divcss5.com/shili/s699.shtml">ul li css interlaced color-changing CSS Li list layout interlaced background color not </a></li>
- </ul>
2. CSS code:
-
- ul.array{margin:0 Auto; width:300px; Background:url (m-top.gif) no-repeat 0 5px}
- Ul.array li{height:30px; line-height:30px; text-align:left; overflow:hidden;
width:100%; TEXT-INDENT:28PX}
3. Effect
Browser effect CSS ordered list layout
4. Full HTML source code
-
- <! DOCTYPE HTML>
- <html>
- <head>
- <Meta http-equiv= "content-type" content= "text/html; Charset=utf-8 " />
- <title> ordered list layout DIVCSS5 online demo </title>
- <link href="images/style.css" rel="stylesheet" type= "Text/css"/>
- <!--www.divcss5.com--
- </head>
- <body>
- <ul class="Array">
- <li><a href=" http://www.divcss5.com/css-texiao/texiao745.shtml ">
continuously scrolls one data div at a time css js scrolling effect </a> </li>
- <li ><a href= "http://www.divcss5.com/wenji/w744.shtml" > parent container box div Height cannot be adaptively resolved </a></ Li>
- <li><a href=" http://www.divcss5.com/wenji/w743.shtml "> why div CSS Web pages cannot be horizontally centered in the FF browser </a>< /li>
- <li ><a href= "http://www.divcss5.com/w3c/w742.shtml" >xhtml (DIV&NBSP;CSS) Code seven basic specifications </a></li>
- <li><a href=" http://www.divcss5.com/shili/s733.shtml "> left logo right ad picture layout div css Floating Layout Instance </a></< Span class= "Tag-name" >li>
- <li ><a href= "http://www.divcss5.com/shili/s731.shtml" > Shanghai's best sexual function hospital says it can be put: a simple navigation bar for DIV+CSS code layout </a>< span class= "tag" ></li>
- <li><a href=" http://www.divcss5.com/shili/s730.shtml ">div css absolute positioning layout case Position layout Instance </a></li>
- <li><a href="http://www.divcss5.com/shili/s699.shtml">ul li css interlaced color-changing CSS Li list layout interlaced background color not </a></li>
- </ul>
- </body>
- </html>
5. Full CSS Code
-
- @charset "Utf-8";
- /* divcss5-css-www.divcss5.com */
- Body, Div, UL, li{margin:0; padding:0;font-style:normal;
font:12px/22px "\5b8b\4f53", Arial, Helvetica, Sans-serif}
- OL, UL, Li{list-style:none}
- img {border:0; Vertical-align:middle}
- Body{color: #000000; background: #FFF; Text-align:center}
- A{color: #000000; Text-decoration:none}
- A:hover{color: #BA2636; Text-decoration:underline}
-
- ul.array{margin:0 Auto; width:300px; Background:url (m-top.gif) no-repeat 0 5px}
- Ul.array li{height:30px; line-height:30px; text-align:left;
Overflow:hidden; width:100%; TEXT-INDENT:28PX}
div CSS Line number implementation CSS display line number sequence value layout