I\'m trying to get 2 divs on the same line, I\'ve got
-
Add float : left; attribute to the div.menu
讨论(0)
-
line-height(child-elements) with a combination of the previous answers
讨论(0)
-
You can play with float:
float: left;
float: right;
clear: both;
This is not always easy to do.
Another option is to use
display: inline-block;
or to use a span.
讨论(0)
-
#NavigationMenu {
float: left;
}
.SearchBox {
float: right;
}
.MenuDiv {
overflow: hidden; /* adjusts the height of .MenuDiv to wrap its children */
}
讨论(0)
-
Set
display: inline-block;
And then set their widths as you need (as an absolute value or percentages of the parent container)
Live Demo
讨论(0)
- 热议问题