开发者

How to display <span> and <ul> inline inside of <div>

开发者 https://www.devze.com 2022-12-18 07:55 出处:网络
I want the foll开发者_StackOverflow社区owing code to display only 1 line of text.How can I get rid of the break between the span and the ul?

I want the foll开发者_StackOverflow社区owing code to display only 1 line of text. How can I get rid of the break between the span and the ul?

<div id="twitter_div">
<span class="talenthouse">@twittername: </span>
 <ul id="twitter_update_list">

 </ul>
</div>

With the following CSS:

*{
 margin: 0;
 padding: 0;
}

#twitter_div{
 font-family:"lucida grande",tahoma,arial,sans-serif;
 color: #999999;
 font-size: 71%;
 background: url(images/twitter_bg.gif) top left no-repeat;
 width: 965px;
 height: 48px;
 overflow: auto;
 padding: 15px 0 0 85px;
}

.talenthouse{
 font-family: "Helvetica Neue", "lucida grande",tahoma,arial,sans-serif;
 color: #80c242;
 font-weight: bold;
 font-size: 135%;
 display: inline;

}

ul#twitter_update_list{
 list-style: none;
 width: 780px;
 height: 15px;
 display: inline;
}


Try this CSS.

<style type="text/css">
    ul, li, ol{display:inline}
</style>


Short answer: put this in your CSS.

ul#twitter_update_list, ul#twitter_update_list li { display: inline; }


Try to use a reset sheet to remove all paddings/margins from the elements. Google for 'eric meyer reset sheet'.

Then put the list an the content to display:inline;


You can set the CSS to display the UL inline. This will also remove the dots.

 #twitter_div li { display: inline; }

Thanks

Andi


I believe this should work:

#twitter_div span { float: left; }
#twitter_update_list { float: left; margin: 0; }

EDIT: I just added the margin: 0 which brings the list up to the same level as the span.

0

精彩评论

暂无评论...
验证码 换一张
取 消