Jump to content
  • 0

Прошу осмотреть работу.


bulleet
 Share

Question

Не могу понять как сделать всю страницу определенного размера. А самое главное - это то, что при уменьшении окна браузера, кнопки меню смещаются друг под друга.

Исходник

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>ТИТУЛ</title>
<style type="text/css" media="screen">
html{margin:10px 20px;}
</style>

<link rel="stylesheet" href="main.css" type="text/css" />
<!-- Таблицы стилей main.css -->

</head>

<body>

<!-- Начало кода "Основное меню" -->
<div id="nav">

<ul class="current">
<li><a href="***"><b>Главная</b></a>
<ul class="sub_active">
<li class="current_sub"><a href="***">***</a></li>
<li><a href="***">***</a></li>
<li><a href="***">***</a></li>
<li><a href="***">***</a></li>
</ul>
</li>
</ul>

<ul class="select">
<li><a href="***"><b>Магазин</b></a>
<ul class="sub">
<li><a href="***">***</a></li>
<li><a href="***">***</a></li>
<li><a href="***">***</a></li>
<li><a href="***">***</a></li>
<li><a href="***">***</a></li>
<li><a href="***">***</a></li>
</ul>
</li>
</ul>


<ul class="select">
<li><a href="***"><b>***</b></a>
<ul class="sub">
<li><a href="***">***</a></li>
<li><a href="***">***</a></li>
<li><a href="***">***</a></li>
<li><a href="***">***</a></li>
<li><a href="***">***</a></li>
</ul>
</li>
</ul>

<ul class="select">
<li><a href="***"><b>***</b></a>
<ul class="sub">
<li><a href="***">***</a></li>
<li><a href="***">***</a></li>
<li><a href="***">***</a></li>
<li><a href="***">***</a></li>
</ul>
</li>
</ul>

<ul class="select">
<li><a href="***"><b>***</b></a>
<ul class="sub">
<li><a href="***">***</a></li>
<li><a href="***">***</a></li>
</ul>
</li>
</ul>

</div>
<!-- Конец кода "Основное меню" -->

<br /><br /><br /><br />

</body>
</html>

CSS

body {
background-color: #000;
}

ul#nav {
list-style-type:none;
margin:0;
padding:0;
}

#nav {
float:left;
width:100%;
height:75px;
position:absolute;
margin:200px 10px 10px;
}

#nav .select, #nav .current {
margin:0;
padding:0;
list-style:none;
display:inline;

}

#nav li {
font-family: Arial;
display:inline;
margin:0;
padding:0;
height:auto;
}

#nav .select a, #nav .current a {
display:block;
height:40px;
float:left;
background: url("images/left_nav.png") no-repeat left top;
padding:0 0 0 5px;
text-decoration:none;
font-size:14px;
line-height:40px;
white-space:nowrap;
margin-right: 2px;
z-index: 500;
}

#nav .select a b, #nav .current a b {
height:100%;
display:inline-block;
background:url("images/right_nav.png") no-repeat right top;
padding:0 20px 0 15px;
color:#ddd;
}

#nav .select a:hover, #nav .select li:hover a {
background-position:0 -50px;
cursor:pointer;
}

#nav .select a:hover b, #nav .select li:hover a b {
background-position:100% -50px;
color:#fff;
}

#nav .sub {
display:none;
}

#nav .current a {
background-position:0 -50px;
border-color:#046;
}
#nav .current a b {
background-position:100% -50px;
color:#fff;
}


#nav .sub li a:hover, #nav .select a:hover .sub li a:hover, #nav .select li:hover .sub li a:hover, #nav .sub_active .current_sub a, #nav .sub_active a:hover {
color:#fff;
text-decoration:underline;
}


#nav .select li a:hover .sub, #nav .select li:hover .sub, #nav .sub_active {
display:block;
position:absolute;
width:100%;
height: 35px;
top:40px;
left:0;
background:#171717;
padding:0;
z-index:100;
}

#nav .sub_active {
z-index:10;
}

#nav .sub, #nav .sub_active {
margin:0;
padding:0;
list-style:none;
}


* html #nav .sub_active, * html #nav .select a:hover .sub {
z-index:-1;
margin-top:0;
margin-top:1px;
}

#nav .sub_active a {
height:25px;
float:left;
text-decoration:none;
line-height:24px;
white-space:nowrap;
font-weight:normal;
}

#nav .sub_active a, #nav .select a:hover .sub li a, #nav .select li:hover .sub li a {
display:inline;
background:none;
padding:0 10px;
margin:0;
font-size:13px;
width:auto;
white-space:nowrap;
font-weight:normal;
border:0;
color:#eee;
height:35px;
line-height:35px;
}

Edited by bulleet
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy