sanchitjain
New Member
- Messages
- 1
- Reaction score
- 0
- Points
- 0
Hi!!
I'm new 2 web development.
I created a menu using CSS but it gets distorted when I resize the page. U can find the page at http://sanchitspeaks.co.cc/a.html.
Plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz help me out.
I'm new 2 web development.
I created a menu using CSS but it gets distorted when I resize the page. U can find the page at http://sanchitspeaks.co.cc/a.html.
Plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz help me out.
Code:
<?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">
<head>
<title>Just a menu</title>
</head>
<style type="text/css">
ul.menu { list-style-type: none; position: absolute; left: 10%}
ul.menu li { display: inline;
float: left; }
ul.menu a { background-color: black;
color: white;
padding-left: 5em;
padding-right: 5em;
padding-top: 0.5em;
padding-bottom: 0.5em;
border-style: solid;
border-color: black;
border-size: 2px;
text-decoration: none;
font-family: Verdana;
font-weight: bold;
text-decoration: none}
ul.menu li div { display: inline;
background-color: black;
color: white;
}
ul.menu span { background-color: black;
color: white;
padding-left: 5em;
padding-right: 5em;
padding-top: 0.5em;
padding-bottom: 0.5em;
border-style: solid;
border-color: black;
border-size: 2px;
text-decoration: none;
font-family: Verdana;
font-weight: bold;
text-decoration: none }
ul.menu li div a { display : none;
background-color: black;
color: white;
padding-left: 4em;
padding-right: 4em;
padding-top: 0.5em;
padding-bottom: 0.5em;
border-style: solid;
border-color: black;
border-size: 2px;
text-decoration: none;
font-family: Verdana;
font-weight: bold;
text-decoration: none}
ul.menu li:hover a{ background-color: blue; border-color: blue }
ul.menu li:hover div span { background-color: blue; border-bottom-color: black }
ul.menu li:hover div a { display: block; }
ul.menu div a:hover { background-color: green; border-color: green }
body { background-color: grey }
</style>
</head>
<body>
<center>
<ul class="menu">
<li><a href="#">Home</a></li>
<li><a href="#">Blog</a></li>
<li><div><span>Tech world</span><a href="#">Open source</a><a href="#">Microsoft</a><a href="#">Other</a></div></li>
<li><a href="#">Forum</a></li>
</ul>
</center>
</body>
</html>
Last edited: