开发者

how to avoid line breaks between text and lists

i have the following code on a web page:

 Team:
        <ul class="checkboxTree[0] checkboxTree" id="tree2">

. . . . .开发者_StackOverflow中文版 

the ul list shows up a line below the Text "Team". How can i get it to show up directly to the right of the team and not have any line break.


An unordered list is a block-level element.

I'd need more information to give you good advice, but the simplest way is a CSS rule:

#tree2 { display: inline }

or

#tree2 { display: inline-block }

See the CSS spec for the gory details.


You can fix this by using css like display, or float. Example:

.checkboxTree
{
float: left;
}

For more information:
http://www.w3schools.com/css/pr_class_display.asp
http://www.w3schools.com/css/pr_class_float.asp

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜