Reputation: 47
I have been trying to align my menu div at the bottom of the my logo div in the same line as of my logo inside my header.
<div id="header">
<div id="top-bar">
</div>
<div id="clear"></div>
<div id="logo">
<img id="logoimg" src="images/KTMLogo.png" />
</div>
<div id="menu">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Movies</a></li>
<li><a href="#">Theaters</a></li>
</ul>
</div>
</div>
CSS
#header {
background-color:#e1874b;
border-bottom-left-radius:25px;
border-bottom-right-radius:25px;
float:left;
position:relative;
}
#logo {
width:280px;
}
#logo img {
max-height:240px;
max-width:240px;
}
#menu {
font-size:18px;
padding:20px;
background: linear-gradient(to bottom, rgba(255,255,255,0.3) 0%,rgba(255,255,255,0)100%);
width:500px;
margin-left:300px;
}
I want my menu div to start from the bottom of my logo in the same line.
Upvotes: 0
Views: 89
Reputation: 2189
Try:
#menu {
font-size:18px;
padding:20px;
background: linear-gradient(to bottom, rgba(255,255,255,0.3) 0%,rgba(255,255,255,0)100%);
width:500px;
margin-left:300px;
float: left;
}
To have your menu on the same line with your image use float: left;
And to have the list in the same line use display: inline-block;
#menu ul li {
display:inline-block;
}
Upvotes: 0
Reputation: 15767
Menu under the logo
#menu {
font-size:18px;
padding:0px;
background: linear-gradient(to bottom, rgba(255,255,255,0.3) 0%,rgba(255,255,255,0)100%);
width:500px;
margin-left:0px;
}
i think you need this
#header {
background-color:#e1874b;
border-bottom-left-radius:25px;
border-bottom-right-radius:25px;
float:left;
position:relative;
}
#logo {
width:280px;
}
#logo img {
max-height:240px;
max-width:240px;
}
#menu {
font-size:18px;
padding:0px;
background: linear-gradient(to bottom, rgba(255,255,255,0.3) 0%,rgba(255,255,255,0)100%);
width:500px;
margin-left:0px;
}
#menu ul{
display:inline-block;
}
#menu ul li{
display:inline-block;
}
Upvotes: 0
Reputation: 4868
add
#menu ul li {
display:inline-block;
}
to place the menu items on one line.
to place then to the right of the image add.
#menu,#logo {
display:inline-block;
}
and remove or correct the margin-left rule under menu selector.
Upvotes: 1