English 中文(简体)
社会保障局将一个和一个案文与一个标题一致。
原标题:CSS align a and text in an li tag
  • 时间:2011-10-07 21:05:32
  •  标签:
  • html
  • css

在这方面,我期待着创造的东西。 美元数额与j Query提交表格有关。

“entergraph

在这里,我刚才谈到:

<div class="donate_left_column">
    <p>You can be the autemped lorem ipsum quisciis alic to dolupidebis consed deo vellor quam quam re:</p>
    <div class="donate_amounttable">
        <ul>
            <li><a class="donate_click" id="100" href="#">$100</a>provides 20 new novels for a college prep language arts class.</li>
            <li><a class="donate_click" id="200" href="#">$200</a>provides 1 week of childcare for a parent starting a new job.</li>
        </ul>
    </div>
</div>

类型:

.donate_amounttable 
{
}

.donate_amounttable ul
{
    display: inline;

}

.donate_amounttable li
{
    display: inline;
    font-size: 14px;
    color: #000;
    padding-bottom: 6px;
}

.donate_amounttable a
{
    display: block; 
    font-family: din-condensed-web,sans-serif;
    background-color: #bfd475;
    padding: 6px;
    width: 50px;
    font-size: 24px;
    color: #fff;
    text-align: right;
    float: left;
    clear: left;
}

问题在于它最终要看:

“enterography

http://jsfiddle.net

得到帮助!

最佳回答

Your css is only having some little margin problems.
Try something like this: http://jsfiddle.net/6G8wr/2/

问题回答

这是我现在发现的最好情况:。 http://jsfiddle.net/6G8wr/6/

I used <sup> tag which is used for suprascript text and a small styling.

Try something like this:

    div.donate_amounttable li
    {
        width:275px;
        display:block;
        font-size: 14px;
        color: #000;
        clear:both;
        padding:5px 0;
    }

    div.donate_amounttable a
    {
        display: block; 
        font-family: din-condensed-web,sans-serif;
        background-color: #bfd475;
        padding:5px 5px 5px 15px;
        width: 50px;
        font-size: 24px;
        color: #fff;
        text-align: right;
        float:left;
        margin-right:10px;
        text-decoration:none;
    }

You can view a working model here: http://ninja-code.net/extra/stackoverflow_test2.php

You can tweak it to add more spacing or make the li longer.

It looks like you main problem is floating the image and then not clearing. That makes your LI elements not wrap their children the way they normally would. This will take care of images and float them and it should also wrap nicely.

<style>
.donate_amounttable
{
}

.donate_amounttable ul
{    
 margin: 0px;
 padding: 0px;
}

.donate_amounttable ul li
{
    font-size: 14px;
    color: #000;
    margin-bottom: 6px;
    width: 450px;
}


.wordSpacing {
float: left;
margin-left: 12px;
width: 310px;
}
.donate_amounttable a
{
    display: block;    
    font-family: din-condensed-web,sans-serif;
    background-color: #bfd475;
    padding: 6px;
    width: 50px;
    font-size: 24px;
    color: #fff;
    text-align: right;
    float: left;
    clear: left;
}
</style>

你必须在这里增加一些口号,以便用文字总结你想要的东西,确保儿童的生活和生活都跨越。

<div class="donate_amounttable">
 <ul>
  <li><a class="donate_click" id="100" href="#">$100</a><div class="wordSpacing">provides 20 new novels for a college prep language arts class.</div><div style="clear: left;"></div></li>
  <li><a class="donate_click" id="200" href="#">$200</a><div class="wordSpacing">provides 1 week of childcare for a parent starting a new job.</div><div style="clear: left;"></div></li>
 </ul>
</div>





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签