如何显示h1和ul链接? [英] How to display h1 and ul link inline?

查看:125
本文介绍了如何显示h1和ul链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在同一行中显示我的h1和ul标签?这是我的标题文本在主要内容之上(这不是与我不得不添加更多的文本的问题)

How do I display my h1 and ul tag in the same line? This is for my header text which is above the main content (This isn't anything to do with the question I had to add more text)

这是我的代码:

HTML:

<div id="header">
<h1>Logo</h1>
<ul>
<li><a href="index.html">Home</a> |</li>
<li><a href="fixtures.html">Fixtures & Results</a> |</li>
<li><a href="news.html">News</a> |</li>
<li><a href="players.html">Player</a> |</li>
<li><a href="table.html">Table</a> |</li>
</ul>
</div>

CSS:

#header{
margin:0px;
padding:0px;
color:white;
background-color:red;
width:100%;
}
#header h1{
display:inline;
}
#header ul li{
display:inline;
}
#header ul li a{
text-decoration:none;
font-size:16px;
font-weight:bold;
color:white;
}
#header ul li a:hover{
text-decoration:underline;
}


推荐答案

add #header ul {display:inline; } 。这应该可以。

add #header ul { display:inline; }. That should do it.

http://jsfiddle.net/ GP2pX /

这篇关于如何显示h1和ul链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆