gpt4 book ai didi

CSS 对齐 : left and right issue

转载 作者:行者123 更新时间:2023-11-28 04:23:45 25 4
gpt4 key购买 nike

尽管支持,我希望所有文本都能正确对齐 | 个人资料 | Logout 左对齐,而 Welcome 右对齐。为什么会这样?

<div id="header">
<a href="#">Support</a>&nbsp;&nbsp;|&nbsp;&nbsp;
<a href="#">Profile</a>&nbsp;&nbsp;|&nbsp;&nbsp;
<a href="#">Logout</a>
<p>Welcome, Today is <script type="text/javascript">timeinit();</script></p>
</div>

#header {
background: #00557F;
border-bottom: 2px gray;
padding: 1em;
width: 100%;
height: 50px;
}

div#header p {
color: #B7DDF2;
font: 10px Arial;
margin: 0;
text-align: right;
width: 100%;
}

div#header a {
text-decoration: none;
color: #B7DDF2;
font: 10px Arial;
text-align: right;
margin: 0;
width: 100%;
}
div#header a:hover {
font: 10px Arial;
color: #FFCF8B;
text-decoration: underline;
text-align: right;
margin: 0;
width: 100%;
}

最佳答案

#header {
text-align:right;
}

将上面添加到你的div

关于CSS 对齐 : left and right issue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10685518/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com