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