VBdotnet2005
asked on
Html - link
Please see attachment. How can I get the result like image #2. When hover a link, I want "Home" link (and other) to be in the center and also I want to be able to adjust the width and height?
<head>
<style>
#menu {
height:61px;
background-color:#D2691E;
font-size:10pt;
line-height:72px;
}
#menu img {
float:left;
width:150px;
height:60px;
padding-right:18px;
}
.linkStyle
{
color: #FFFFFF;
text-decoration: none;
font-size:small;
font-family: "Verdana";
padding-right: 40px;
color: #dde4ec;
}
a:hover
{
background-color: #bfcbd6;
color: #465c71;
text-decoration: none;
}
.clearFloat {
clear:both;
}
menu-01.jpg
Whats your HTML for this?
ASKER
<body>
<div id="menu">
<img src="temp.gif" />
<a href="http://mysite/home.html" class="linkStyle">Home</a>
<a href="http://mysite/documents.html" class="linkStyle">Document s</a>
<a href="http://mysite/purchased.html" class="linkStyle">Purchase d</a>
<a href="http://mysite/Ordered_by.html"class="linkStyle">O rderedby</ a>
<a href="http://mysite/internal_sales.html" class="linkStyle">Internal Sales</a>
<a href="http://mysite/Customername.html" class="linkStyle">Customer Name</a>
</div>
<div>
Content goes here
</div>
</body>
<div id="menu">
<img src="temp.gif" />
<a href="http://mysite/home.html" class="linkStyle">Home</a>
<a href="http://mysite/documents.html" class="linkStyle">Document
<a href="http://mysite/purchased.html" class="linkStyle">Purchase
<a href="http://mysite/Ordered_by.html"class="linkStyle">O
<a href="http://mysite/internal_sales.html" class="linkStyle">Internal
<a href="http://mysite/Customername.html" class="linkStyle">Customer
</div>
<div>
Content goes here
</div>
</body>
Change the padding on .linkStyle{...} to
padding: 0 20px;
padding: 0 20px;
ASKER
I tried it and it returned same result
Can't look the same since the CSS has changed, look at this fiddle
http://jsfiddle.net/GaryC123/3tqs77m4/1/
http://jsfiddle.net/GaryC123/3tqs77m4/1/
ASKER
My bad. I had to close and open my Visual Studio 2010 pro to see the change. How can I control the width and height of it?
Add to .linkStyle {...}
display:inline-block
then you can add height and width
display:inline-block
then you can add height and width
ASKER
I tried this and it did not stay in the center.
display:inline-block;
height:50px;
display:inline-block;
height:50px;
ASKER
Please see image
menu-02.jpg
menu-02.jpg
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you Gary
ASKER
I hope you don mind this. How can I remove this white gap? I want to move the menu all the way to the top.
menu-03.jpg
menu-03.jpg
Add
body{
margin:0
}
body{
margin:0
}
ASKER
excellent. Thanks again