October 15, 201213 yr What is the html code to make horizontal boxes i need to make some boxes go from left to right but all i can find is on top of each other, you can see example here <a href="http://www.carinsura...mation.com">car insurance quotes</a> where the boxes are next to each other, and will this affect the page width on my site. Someone told me use DIV tags but how do i put this in HTML code?. Edited October 15, 201213 yr by james2005
October 15, 201213 yr The link you've given us isn't a proper link. Mind correcting it so we can see your example?
October 15, 201213 yr Your link is broken. The usual method to make elements side by side (including div boxes) is to add float: left; or float: right; to all the elements that you want side by side. Make sure that the width of any containing element is enough for all the box widths including their side margins, side padding and side borders. Then clear the floats so that following elements don't appear in the wrong place.
October 15, 201213 yr As Wickham said, add float:left; to the CSS class for the boxes you want beside each other.
October 15, 201213 yr You Can use following code: CSS ========================================== #box{ float: left; width: 1000px; /* as per your requirement */ } #box ul{ margin: 0px; padding: 0px; } #box ul li{ list-style: none; display: block; float: left; width: 245px; /* as per your requirement */ margin-right: 5px; } ======================================== HTML ======================================= <div id="box"> <ul> <li>box content will come here</li> <li>box content will come here</li> <li>box content will come here</li> </ul> </div>
Create an account or sign in to comment