0
因此在我的屏幕上导航栏几乎延伸到了屏幕的尽头,而在更大的屏幕上它没有达到预期的限制我是创建网站的初学者我想请问在这里是什么问题的帮助..我尝试使用宽度的百分比,但是当我让屏幕更小的内容得到所有混乱,我不想我想要一个非响应菜单,如eBay我猜。导航菜单的问题在其他屏幕上看起来更小
.search [type=text]{
width: 30em;
\t position:absolute;
\t top:6%;
\t left:15%;
box-sizing: border-box;
border: 2px solid #ccc;
border-radius: 4px;
font-size: 1em;
background-color: white;
background-repeat: no-repeat;
padding: 12px 20px 12px 40px;
\t
}
.Navigation{
\t font-family:Arial;
\t font-size:1em;
\t width:80.9em;
\t position:fixed;
\t top:6em;
\t left:2em;
list-style-type: none;
\t padding:0%;
\t border-bottom: 1px solid grey;
\t border-top: 1px solid grey;
}
.Navigation a {
float: left;
\t
}
.Navigation li a{
display: inline-block;
color: #484849;
text-align: center;
padding: 0.7em 4.93em;
\t text-decoration: none;
\t
}
.Navigation a:hover {
border-bottom: 1px solid red;
}
/* class="active" */
.active {
\t border-top: 1px solid red;
border-bottom: 1px solid red;
\t
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css"/>
\t <style type="text/css">
\t .logo{
\t \t position:absolute;
\t \t top:1em;
\t \t left:3em;
\t }
\t
\t </style>
</head>
<body>
<a class="logo" href="index.php"><img src="logo.png" alt="logo Icon" height="80"></a>
</body>
<div class="wrapper">
<ul class="Navigation">
<li><a href="Mobiles.php">Mobiles</a></li>
<li><a href="Vehicles.php">Vehicles</a></li>
<li><a href="Games.php">Games</a></li>
<li><a href="Clothes.php">Clothes</a></li>
<li><a href="Accessories.php">Accessories</a></li>
<li><a href="Other.php">Other</a></li>
</ul>
</div>
<form class="search">
<input type="text" name="search" placeholder="Search..">
</form>
</body>
</html>
</html>
但这并不意味着我正在创建响应式菜单吗?我不想ebay例如让你调整浏览器的大小,菜单在所有内容都不会改变。 – Alaa
使用百分比会改变宽度,是的。对于你所描述的我将使用@media查询,他们完全满足你的需求:) – Shtut