div CSS Line number implementation CSS display line number sequence value layout

Source: Internet
Author: User

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

    1. <ul class="Array">
    2. <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>
    3. <li><a href=" http://www.divcss5.com/wenji/w744.shtml "> parent container box div Height cannot be adaptively resolved </a></ li> 
    4. <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> 
    5. <li><a href=" http://www.divcss5.com/w3c/w742.shtml ">xhtml (DIV&NBSP;CSS) code seven basic specifications </a></ Li> 
    6. <li ><a href= "http://www.divcss5.com/shili/s733.shtml" > left logo  right ad picture layout  div css Floating Layout Instance </a> </li> 
    7. <li><a href=" http://www.divcss5.com/shili/s731.shtml "> a simple navigation bar for DIV+CSS code layout </a></ li> 
    8. <li ><a href= "http://www.divcss5.com/shili/s730.shtml" >div css absolute positioning layout case  position Layout instance </a></ li> 
    9. <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>
    10. </ul>

2. CSS code:

      1. ul.array{margin:0 Auto; width:300px; Background:url (m-top.gif) no-repeat 0 5px}
      2. 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

    1. <! DOCTYPE HTML>
    2. <html>
    3. <head>
    4. <Meta http-equiv= "content-type" content= "text/html; Charset=utf-8 " />
    5. <title> ordered list layout DIVCSS5 online demo </title>
    6. <link href="images/style.css" rel="stylesheet" type= "Text/css"/>
    7. <!--www.divcss5.com--
    8. </head>
    9. <body>
    10. <ul class="Array">
    11. <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> 
    12. <li ><a href= "http://www.divcss5.com/wenji/w744.shtml" > parent container box div Height cannot be adaptively resolved </a></ Li> 
    13. <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> 
    14. <li ><a href= "http://www.divcss5.com/w3c/w742.shtml" >xhtml (DIV&NBSP;CSS) Code seven basic specifications </a></li> 
    15. <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> 
    16. <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> 
    17. <li><a href=" http://www.divcss5.com/shili/s730.shtml ">div css absolute positioning layout case   Position layout Instance </a></li> 
    18. <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>
    19. </ul>
    20. </body>
    21. </html>

5. Full CSS Code

    1. @charset "Utf-8";
    2. /* divcss5-css-www.divcss5.com */
    3. Body, Div, UL, li{margin:0; padding:0;font-style:normal;
      font:12px/22px "\5b8b\4f53", Arial, Helvetica, Sans-serif}
    4. OL, UL, Li{list-style:none}
    5. img {border:0; Vertical-align:middle}
    6. Body{color: #000000; background: #FFF; Text-align:center}
    7. A{color: #000000; Text-decoration:none}
    8. A:hover{color: #BA2636; Text-decoration:underline}
    1. ul.array{margin:0 Auto; width:300px; Background:url (m-top.gif) no-repeat 0 5px}
    2. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.