这是标题部分,在同一个 div 中左侧包含 Logo ,右侧包含登录链接。我一直在尝试让登录文本不从 #header_section
中溢出。
我的代码有什么问题?顺便说一下,我刚刚开始学习 CSS。
div#container
{
background: url(../images/bg_inner.png) repeat;
margin-left: auto;
margin-right: auto;
width: 950px;
text-align: left;
}
div#header_section
{
width: 930px;
height: 65px;
position: relative;
margin: 5px;
}
#logo
{
background: url(../images/logo.png) left no-repeat;
margin: 5px;
border: none;
height: 55px;
width: 200px;
}
.login
{
font-size: 22px;
color:#4A4A4A;
width: 60px;
float: right;
}
<div id="header_section">
<a href="index.php" id="logo"></a>
<a href="login.php" class="login">Login</a>
</div>
最佳答案
大胆猜测:改变
div#header_section
{
overflow: hidden;
...rest of stuff
}
关于css - 登录似乎从 div 溢出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6947832/