The Application of UL-LI label combined with CSS

Source: Internet
Author: User
The Application of UL-LI label combined with CSS

In CSS layout, ul and li are very common. Use DIV and CSS to create a table-free layout.

In fact, Dreamweaver also has examples of built-in CSS layout, such:

 

  1. LI code format:
    A) format the list with CSS: ul li {
    List-style-type: none;
    } For example:

    • Supply and Demand Information

    B) If you want to replace the list operator with an image, then ul li {
    List-style-type: none;
    List-style-image: url (images/icon.gif );
    } For example:

    • Supply and Demand Information

    C) For left alignment, use the following code: ul {
    List-style-type: none;
    Margin: 0px;
    } For example:

    • Supply and Demand Information

    D) If you want to add a background color to the list, use the following code: ul {
    List-style-type: none;
    Margin: 0px;
    }
    Ul li {
    Background: # CCC;
    } For example:

    • Supply and Demand Information

    E) If you want to add the MOUSEOVER background color effect to the list, use the following code: ul {list-style-type: none; margin: 0px ;}
    Ul li a {display: block; width: 100%; background: # ccc ;}
    Ul li a: hover {background: #999;} Note: display: block; this line must be added to display the block!

    For example:

    • Supply and Demand Information

    F) horizontal arrangement of elements in. LI, key FLOAT: LEFT: ul {
    List-style-type: none;
    Width: 100%;
    }
    Ul li {
    Width: 80px;
    Float: left;
    }

    •  
    • Supply and Demand Information
    • Supply and Demand Information Network

 

Related Article

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.