Reputation: 7149
I am designing a project and i have faced a bug :
The design of the page ( especially the menu bar ) change on zooming
How can i prevent this ? Is there a shortage in my code ?
HTML Code
<html>
<head runat="server">
<title>Movie Guide</title>
<link href="StyleSheet.css" rel="stylesheet" />
<style>
#main {
text-align: center;
}
#main-menu-container {
text-align: center;
}
#main-menu {
display: inline-block;
width: 1024px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div id="main" style="text-align: center">
<img src="image.jpg" width="925" height="125" />
<div id="main-menu-container">
<div id="main-menu">
<div id="menubar">
<ul id="menu">
<li class="current"><a href="page1.aspx">Title 1</a></li>
<li><a href="page2.aspx">Title 2</a></li>
<li><a href="page3.aspx">Title 3</a></li>
<li><a href="page4.aspx">Title 4</a></li>
<li><a href="page5.aspx">Title 5</a></li>
</ul>
</div>
</div>
</div>
</div>
</form>
</body>
</html>
CSS Code
body {
font: normal 80% Arial, Helvetica, sans-serif;
background: #23244e;
color: #000;
}
#menubar {
width: 920px;
height: 50px;
text-align: center;
margin: 0 auto;
background: #1D1D1D;
background: -moz-linear-gradient(#535353, #1d1d1d);
background: -o-linear-gradient(#535353, #1d1d1d);
background: -webkit-linear-gradient(#535353, #1d1d1d);
border-radius: 15px 15px 15px 15px;
-moz-border-radius: 15px 15px 15px 15px;
-webkit-border: 15px 15px 15px 15px;
-webkit-box-shadow: rgba(0, 0, 0, 0.5) 0px 0px 5px;
-moz-box-shadow: rgba(0, 0, 0, 0.5) 0px 0px 5px;
box-shadow: rgba(0, 0, 0, 0.5) 0px 0px 5px;
}
ul#menu li {
padding: 0 0 0 0px;
list-style: none;
margin: 2px 0 0 0;
display: inline;
background: transparent;
}
ul#menu li a {
float: left;
font: bold 120% Arial, Helvetica, sans-serif;
height: 24px;
margin: 10px 0 0 20px;
text-shadow: 0px -1px 0px #000;
padding: 6px 20px 0 20px;
background: transparent;
border-radius: 7px 7px 7px 7px;
-moz-border-radius: 7px 7px 7px 7px;
-webkit-border: 7px 7px 7px 7px;
text-align: center;
color: #FFF;
text-decoration: none;
}
Upvotes: 2
Views: 947
Reputation: 36
I haven't used css for a while so my apologies if this is not the correct solution, but I believe if you put under the main menu:
position:absolute;
the menu should no longer move
Upvotes: 1