How Do I Position Buttons So They Align Horizontally With Another Element?
I need some help with my styling. I'm trying to get a nice looking website, but I just can't seem to do it. I've tried floats, but to no avail. I want to to have the look of the 'A
Solution 1:
Add this CSS classes :
ul{
float:right;
}
#brand {
float:left;
}
Add to .navButton
:
display: inline-block;
And add to #header
:
overflow:hidden;
Also replace :
width: 1140px;
with
min-width: 1140px;
width: 100%;
in #navMenu, #footer
and #header
.
Check Fiddle
Solution 2:
why don't you easily use float: left
and float: right
as long as you have given height to your header.
#brand{
float: left;
}
.navButton {
float: right;
}
Solution 3:
Its an easy problem. You messed up the css bad. Here is the link and to the changed css and HTML.
Hope it helps... i have updated the css using element id try not to do that, always use classes for css unless you have a really good reason not to.
Solution 4:
I've created a fiddle to help you fix the issue.
Use float: left
in .navButton class and add clearfix class to the ul containing the .navButton elements. the style definition for the clearfix class is also written in the fiddle. Please try and let us know.
Post a Comment for "How Do I Position Buttons So They Align Horizontally With Another Element?"