【发布时间】:2015-07-26 10:38:50
【问题描述】:
我正在创建一个水平导航栏,并希望对其进行样式化,以便在栏的正上方出现一条细线(请参阅示例)。
如您所见,红色导航栏上方有一条细金线。我想在橙色导航栏上方画一条细黑线。
我的代码如下所示: (CSS)
nav {width:100%;display:block;}
nav ul {list-style-type:none;margin:0;padding:0;text-align:center;background-color:#c0872e}
nav li {display:inline-block;background-color:#c0872e;}
nav a {line-height:35px; color:white; padding:0 30px; font-size:22px; font-family:WindsorDemi.fog Cn; background-color:#c0872e;}
nav a:hover {text-decoration:none}
(HTML)
<div>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="products.html">Products</a></li>
</ul>
</div>
请告诉我如何才能达到这种预期效果。谢谢!
【问题讨论】:
标签: html css navigation center centering