orinoco74 orinoco74 - 1 year ago 103
CSS Question

align content to top in div

I'm not a clever man, just trying to make a responsive page with a left sidebar, so far that's okay, but I cannot figure out how to align the content of the main div to the top.

This is the code: https://jsfiddle.net/kissja74/df8vkn2a/

#content {
position: relative;
max-width: 400px;
margin: 0 auto;

#menu {
position: relative;
width: 50px;
height: 30px;
margin-left: -50px;
background-color: blue;

<div id='content'>
<div id='menu'>menu</div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi interdum porttitor accumsan. Aliquam at egestas lacus, sed ultrices dui.</p>

Answer Source

Add to your style

#menu {float: left}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download