CSS 样式导航按钮
您可以在这里看到我正在尝试做的事情: http://rjlacount.com/clients/GreenTree /
我希望导航 li 自动确定填充,以便它们可以拉伸到内部包装器的整个宽度。因此,如果我添加另一个 li 或删除一个 li,它们仍然会居中,并且每个 li 的填充只会增加/减少以弥补它。
现在,我将最后一个导航 li 浮动到右侧,并为每个导航添加填充,以尝试使其尽可能接近全长。所以这几乎就是我想要的样子,但我想去掉最后两项之间的空格。
这可能吗?感谢您的任何帮助。
You can see an attempt at what I'm trying to do here: http://rjlacount.com/clients/GreenTree/
I want the navigation li's to determine padding automatically so they can stretch across the entire width of the inner wrapper. So, if I added another li or took one out, they would still be centered and the padding of each li would just increase/decrease to make up for it.
Right now I'm floating the last navigation li to the right and adding padding to each one to try to get it as close to full-length as possible. So it's almost how I want it to look, but I have a space between the last two items that I'd like to get rid of.
Is this possible? Thanks for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不相信这会在< IE8,但您始终可以使用条件样式表为这些浏览器提供
float
或display: inline-block
后备。示例
CSS
jsFiddle。
jsFiddle 再加上一个
li
,你会注意到 CSS是常数:PI don't believe this will work in < IE8, but you could always provide a
float
ordisplay: inline-block
fallback to those browsers using a conditional stylesheet.Example
CSS
jsFiddle.
jsFiddle with one more
li
, you'll notice the CSS is constant :P