html - Miss-aligned boxes -
i new html , trying make basic web page layout, aligned , looked fine until started adding content boxes. can please annoying alignment issue having @ moment.
.container { /* auto margins used centering elements horizontally */ margin-right: auto; margin-left: auto; /* box dimensions */ width: 980px; /* colour of box */ border-radius: 10px; padding: 15px; font-size: 0px; } .box1 { width: 100%; height: 160px; background-color: #81bbc9; border-radius: 10px; display: inline-block; margin: 5px 0; /* vertical */ padding: 5px 0; /* horizontal */ text-align: center; font-size: 32px; font-family: sans-serif; } .sidebar { width: 300px; height: auto; background-color: #81bbc9; border-radius: 10px; text-align: center; font-size: 32px; font-family: sans-serif; display: inline-block; margin: 5px 0px; /* vertical */ margin-right: 5px; padding: 40px; /* vertical */ } .content { width: 510px; height: auto; background-color: #81bbc9; border-radius: 10px; text-align: center; font-size: 32px; font-family: sans-serif; display: inline-block; margin: 5px 0px; /* vertical */ margin-left: 5px; padding: 40px; /* vertical */ } p { font-size: 12px; text-align: left; }
<div class="container"> <div class="box1"> <h3>header</h3> </div> <div class="sidebar"> <h3>sidebar</h3> <p> lorem ipsum dolor sit amet, consectetur adipisicing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p> <p> lorem ipsum dolor sit amet, consectetur adipisicing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p> </div> <div class="content"> <h3>content</h3> <p> lorem ipsum dolor sit amet, consectetur adipisicing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p> <p> lorem ipsum dolor sit amet, consectetur adipisicing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p> </div> <div class="box1"> <h3>footer</h3> </div> </div>
update below css.
.content { width: 510px; height: auto; background-color: #81bbc9; border-radius: 10px; text-align: center; font-size: 32px; font-family: sans-serif; display: inline-block; margin: 5px 0px; /* vertical */ margin-left: 5px; padding: 40px; vertical-align: top; /* vertical */ }
Comments
Post a Comment