CSS layout: tabs leaving right space
I have a page designed for tabbed browsing. The tabs are <li>
s, which are displayed as blocks. The parent div of tabs is set to float right. But the last tab is leavi开发者_开发问答ng some space with right. It is not getting attached to the right side portion of window. I want the tab (or the tabs parent) to attach to the right side or it may leave a 1px space.
Here is the fiddle.
Replace this
#menu {
float: right;
height: 34px;
width: 590px;
}
into
#menu {
float: right;
height: 34px;
}
All you need is to delete width of parent div, and all will be OK)))
Your parent div of tabs is floated right, but your <ul>
inside is not. With a set width on #menu, unless your <li>
s take up the full width there will always be space on the right.
You can either remove the width attribute of #menu, or add
float:right;
to #menu ul{}
精彩评论