Simple use of CSS styles

Source: Internet
Author: User

CSSSimple use of styles

When you are working on a project, you can use a row to display the content in several columns.DatalistBinding. But sometimes because we are not a designerCodeNot conducive to ourItemtemplateContent.UseUl + LiIn additionCSSControl, You can implement the scenario of one row and multiple columns, but you cannotDatalistOfItemtemplateBindLi,BecauseDatalistThe generated client code isTableThe layout is not based onHtmlThe format is typographical. Someone knows it. By the way, useRepeaterWidget. RepeaterThe control is output inItemtemplateOfHtmlMarked as follows:

<ASP:Repeater ID= "Repeater1" Runat= "Server">

<Itemtemplate>

<Li>

 <IMG Height= "46" SRC="<%# Eval ("imgurl ")%>" Width= "82">

</Li>

</Li>

</Itemtemplate>

</ASP:Repeater>

The code bound to the backend is omitted. I want to believe that everyone will use it early, so there is no need to repeat it. Of course, the results generated in this way cannot achieve the effect of one row and multiple columns. You must add the CSS style table as follows (add to

<Style Type= "Text/CSS">

Ul

{

Width:180px;

}

Li{

Width:90px;

Float:Left;

}

</Style>

UlThe width is to control the display of several linesLi,Example aboveUlIs180px, LiThe width is90pxAt the same timeLiOfFloatSetLeftIn this way, two rows are displayed in one row.

Finally, put the use case code:

/Files/kevinlzf/css.rar

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.