gpt4 book ai didi

css - 在 css 中声明导航和搜索框

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

我想在导航菜单栏的左侧和右侧声明导航菜单和搜索框,但我的 css 代码不起作用。请帮我解决这个问题。

我的 HTML 代码:

<html>
<head>
<body>

<div id= navigation>
<ul>
<li> <ahref="index.html">Home</a><li>
<li><ahref="Contact.html">Contact Us</a></li>
</ul>
<div id= from>
<form method = post action="" >
<input type="text" class= "form control" placeholder="Search">
<button class="button" type="Submit">"Submit"</button>
</form>
</body>
</html>

CSS 代码:

#body{#width:500px}
#navigation {
float:left;
background: #1b1c1d;
width: 960px;
}
#navigation ul {
list-style: none;
list-style-position: outside;
font-size: 25px;
font- weight: 200;
}
#navigation ul li {
display: inline; padding: 8px 12px;
line-height: 40px;
}
#navigation ul li a {
color: #d5d4d4;
text-decoration: none;
}
#navigation ul li a:hover,
#navigation ul li.active a {
color: #fff;
text-decoration: none;
line-height: 40px;
}
#from{
width:280px;
float: right;
padding-top: 20px;
}

最佳答案

display:inline 添加到#navigation ul

jsFiddle

关于css - 在 css 中声明导航和搜索框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20937524/

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