Div + CSS tips: Insert a small icon in front of Li + marquee

Source: Internet
Author: User

1. Rolling announcement. To create a rolling announcement, add a small icon in front of it and align it. In this case, you can set the background in front of Li and then set the padding left. However, after padding is added, the next column of the announcement will also contain padding, which is difficult to see. I 'd like to add an image in Li. However, the image is not centered. Because the line-height of Li is set. The image CSS has no effect. After searching. The following method can be implemented:

IMG {border: solid 1px # dddddddd; padding: 2px; Vertical-align: middle ;}
<Marquee scrollamount = '2' scrolldelay = '2' ction = 'up' onmouseover = "Stop ()" onmouseout = "Start () "bgcolor =" # ececec "Height =" 192px ">

Application:

<Asp: repeater id = "rpt_gggs" runat = "server">
<Headertemplate> <ul class = "ul_marquee"> <Itemtemplate> <li> <a href = ".../content. aspx? Id = <% # eval ("ID") %> "> <% # eval (" title ") %> </a> </LI> </itemtemplate>
<Footertemplate> </ul> </footertemplate>
</ASP: repeater> </marquee>
</Div>

The result is:

 

====================== Marquee in UL
CSS code:
. Ul_marquee {margin-left: 5px; display: Table ;}
. Ul_marquee Li
{
Line-Height: 150%;
Width: 100%;
Text-align: left;
Font-size: 12px;
}

Remember: Float cannot appear in this way.
. Ul_marquee Li
{
Float: left
Line-Height: 150%;
Width: 100%;
Text-align: left;
Font-size: 12px;
}

--------- Application ----------------------------------------

<Div id = "main_right">
<Div class = "notice">
<H3> <a href = "#" target = "_ blank"> announcement </a> <Div style = "width: 228px; Height: 300px;">
<Marquee scrollamount = '2' scrolldelay = '2' ction = 'up' onmouseover = "Stop ()" onmouseout = "Start () "bgcolor =" # ececec "Height =" 192px ">
<Asp: repeater id = "rpt_gggs" runat = "server">
<Headertemplate> <ul class = "ul_marquee"> <Itemtemplate> <li> <a href = ".../content. aspx? Id = <% # eval ("ID") %> "> <% # eval (" title ") %> </a> </LI> </itemtemplate>
<Footertemplate> </ul> </footertemplate>
</ASP: repeater> </marquee>
</Div>

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.