Reputation: 1183
I don't understand why my links are not the .pushMenu divs (left and right),
html:
<header class="header">
<div class="pushMenu" id="left">
<a href="" title=""><p>l</p></a>
</div>
<div class="pushMenu" id="right">
<a href="" title=""><p>r</p></a>
</div>
<div>
<span class="myTitle">title</span>
<span class="myBy">(by me)</span>
</div>
css:
header {
text-align: center !important;
line-height: 60px;
font-weight: bold;
position: absolute;
top: 0; left: 0; right: 0;
height: 60px;
color: #ffffff;
}
header div.pushMenu {
position: absolute;
width: 30px;
height: 30px;
top: 10px;
border: 1px solid white;
}
header div.pushMenu#left {left: 10px;}
header div.pushMenu#right {right: 10px;}
header div.pushMenu a {
width: 30px;
height: 30px;
display: block;
}
see in action: http://jsfiddle.net/GDQdU/4/
what's wrong ?
Upvotes: 0
Views: 46
Reputation: 4580
This is happening because the line-height
specified for the header
is being rendered by the child elements also. Check below to correct this.
Remove the p
tag from the a
tag and the html will be like this <a href="" title="">r</a>
and add line-height:30px
to the a
tag.
header div.pushMenu a{
line-height:30px;
}
OR
If you want the p tag to be there then make the following css changes
header div.pushMenu p{
margin:0;
line-height:30px;
}
Upvotes: 1