0
지난 웹 페이지를 만든 이후로 어느 정도 시간이 지났으며 많은 것을 잊어 버린 것으로 보입니다. #menu div가 모든 목록 요소와 로고 div를 포함 할만큼 충분히 넓을 때 #menu ul의 마지막 항목이 다음 줄로가는 이유는 해결할 수 없습니다. 여백과 여백은 0으로 설정되어 있습니다. 그런 식으로 메뉴를 이전에 만들었지 만 아마도 뭔가를 잊었을 것입니다. 솔루션을 검색했지만 제대로 작동하지 않습니다.CSS - ul 항목이 한 줄에 없음
질문은 .. 한 줄에있는 항목은 무엇입니까? 850 픽셀의 겹치는 부분이 모두 802 픽셀 너비 일 때 왜곡됩니까?
html, body {margin:0; padding:0}
body {background-image: url("./gfx/background.png"); background-position: 50%; background-repeat: no-repeat;text-align:center; background-color:#fff; font-family:Arial, Helvetica;width:100%}
.main-wrap {width:1000px; margin:0 auto}
#header {height:150px;width:1000px}
#logo {
\t display: block;
\t width: 150px;
\t height: 150px;
\t overflow: hidden;
\t color: #424242;
float:left;
margin: 0;
padding:0;
}
#logo span {
\t background: url("./gfx/logo-small.png");
\t z-index: 5;
\t display: block;
\t width: 150px;
\t height: 150px;
}
.wrap::before {
content: " ";
display: table;
}
.wrap::after{
clear: both;
content: " ";
display: table;
}
/*menu*/
#menu {width:849px;margin:0 0 0 0; padding:0px 150px 0 0}
#menu ul li {list-style: none;}
#menu ul li a {
\t z-index: 5;
\t position: relative;
float:left;
\t display: inline;
\t height: 31px;
\t overflow: hidden;
\t text-decoration: none;
color:#336699;
font-size: 20px;
margin: 0;
padding:0
}
#menu li a:hover,
#menu li a:focus {
\t
height: 31px;
\t margin-top: 0;
color:#fff;
}
#menu li a span {
position: absolute;
\t top: 0;
\t left: 0;
\t display: block;
z-index: -1;
\t height: 31px;
\t cursor: pointer;
}
#menu li a:hover span,
#menu li a:focus span {
\t background: url("./gfx/menu-a.png");
\t background-repeat: no-repeat;
color:#fff;
}
#menu-1,
#menu-1 span {
\t background-position: 0 0;
\t width:119px;
}
#menu-1:hover span,
#menu-1:focus span {
\t background-position: 0px 0px;
}
#menu-2,
#menu-2 span {
\t width: 112px;
}
#menu li a#menu-2:hover span,
#menu li a#menu-2:focus span {
\t background-position: -119px 0px;
}
#menu-3,
#menu-3 span {
\t width: 128px;
}
#menu li a#menu-3:hover span,
#menu li a#menu-3:focus span {
\t background-position: -231px 0px;
}
#menu-4,
#menu-4 span {
\t width: 184px;
}
#menu li a#menu-4:hover span,
#menu li a#menu-4:focus span {
\t background-position: -359px 0px;
}
#menu-5,
#menu-5 span {
\t width: 149px;
}
#menu li a#menu-5:hover span,
#menu li a#menu-5:focus span {
\t background-position: -543px 0px;
}
#menu-6,
#menu-6 span {
\t width: 110px;
}
#menu li a#menu-6:hover span,
#menu li a#menu-6:focus span {
\t background-position: -692px 0px;
}
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>New web</title>
<link rel="stylesheet" href="main.css" type="text/css" />
</head>
<body>
<div class="main-wrap"> <!-- hlavni -->
<div class="wrap">
<div id="header">
<div id = "logo"><a href = "new_web/">
<span> </span>
</a></div>
<div id="menu">
<ul>
<li><a id="menu-1" href="new_web/about-us.html">About Us<span></span></a></li>
<li><a id="menu-2" href="new_web/services.html">Services<span></span></a></li>
<li><a id="menu-3" href="new_web/insurance.html">Insurance<span></span></a></li>
<li><a id="menu-4" href="new_web/meet-our-team.html">Meet Our Team<span></span></a></li>
<li><a id="menu-5" href="new_web/latest-news.html">Latest News<span></span></a></li>
<li><a id="menu-6" href="new_web/contact.html">Contact<span></span></a></li>
</ul>
</div>
</div>
</div>
<div id = "slider">
</div>
<div id = "main">
<!-- first page only -->
<div class="wrapper">
<div id="smart-boxes">
<div id="smart-box-1">
<p>"Change your thoughts and you chagne your world." <span>Norman Vincent Peale</span>
</p>
</div>
<div id="smart-box-2">
<p>High quality psychological services <a>read more...</a>
</p>
</div>
<div id="smart-box-3">
<p>We are a multidisciplinary treatment center <a>read more...</a>
</p>
</div>
</div>
</div>
</div>
<div id="footer">
<div class="wrapper">
<div id="footer-address">
<p>
</p>
</div>
<div id = "footer-links-1">
<p>
<a href= "">Contact Us</a><br />
<a href= "">FAQ</a> <br />
</p>
</div>
<div id = "footer-links-2">
<p>
<a href= "">Terms of use</a><br />
<a href= "">Insurance</a><br />
<a href= "">Our Team</a><br />
</p>
<p class="ext-links">
</p>
</div>
</div>
</div>
</div>
</body>
</html>