January 10, 201115 yr Hey guys, Sorry for a quick-fire question again. If for example I wanted content boxes like this site http://www.cotswoldwebservices.co.uk/ where they have e-commerce, graphic design, seo and marketing etc. how would I go about in creating this? I know it's something to do with the <div> tags? Could you possibly show me a tutorial or something? Once again, sorry but I searched it, but nothing helpful came up. Thanks, Preemo
January 10, 201115 yr You code a container and then code four divs inside with float: left; width: ??px; Make sure that the total widths of 4 divs plus their side margins, side padding and side borders total the width of the container. CSS #container { width: 1000px; overflow: hidden; } #div1, #div2, #div3, #div4 {float: left; width: 240px; padding: 5px; }/*240 + 2*5 = 250 x 4 = 1000*/ <div id="container"> <div id="div1">........</div> <div id="div2">........</div> <div id="div3">........</div> <div id="div4">........</div> </div> Edited January 10, 201115 yr by Wickham
January 10, 201115 yr Author Thank you, I have done that, but now it appears one under the other, as you can see here http://footiefanatics.co.uk/test/index.php Sorry for the questions...
January 10, 201115 yr You haven't got a proper stylesheet, it's got html markup for 404 File Not Found instead of the CSS and your html file must have a doctype at the top before the <html> tag from here http://www.w3.org/QA/2002/04/valid-dtd-list.html Edited January 10, 201115 yr by Wickham
January 10, 201115 yr Author Thanks guys, it's all sorted now! Is there anyway I can center these content boxes?
January 10, 201115 yr add margin:0 auto; to #container in the css Edited January 10, 201115 yr by mteam
Create an account or sign in to comment