View Full Version : Image Margins

12-15-2006, 06:27 AM
Hi folks, im currently working on a website for a uni project, i think its looking pretty good as my initial design, but ive come accross a problem which i cant seem to find up on CSS tutorial sites or google. Basically im trying to add Image margins to my webpage (www.freewebs.com/carlosamegos/Index2.html)

currently i have my page to resize for different viewing screens, but ive been trying to find out how to give my page margins like www.gamefaqs.com has (the images are ignored, tho i think the default image they hav is just a small gradient on the side of the main page, they quite often have full images to advertise games down the sides and sometimes accross, going through contents blocks), so i can make my website look complete on a 1024 screen and a 800.

Ive been messing around with layer properties, giving backgrounds to layers etc, but i cant seem to get it to ignore the image, of course initially i thought it was just a background with some kind of relative centering but i dont hav a clue how theyve done it.

This is my first time using CSS properly so maybe im completely off topic and what im after is a javascript lol, but any help would be appreciatted thanks :)

12-15-2006, 06:36 AM
Okay so if I understand you correctly you don't want content to overlap your background image because it would start to clash?

12-15-2006, 09:14 PM
im not sure if i follow you there, what i want is the hav an image on each side going down the side of my main webpage, so on a 1024 view it looks complete, but when reduced to 800 the images are ignored by the horizontal bar. So like a background with a centering would work, ive tried to create a layer, and then giving it a background image to expand 100%, relative position and centering, but it hasnt worked. www.gamefaqs.com has the margins that im after, just dont know how theyve done it

12-15-2006, 09:22 PM
Set it as the background to the body.

html, body {
/*background stuff here*/

Hmm did you remove the doctype from your page? You need to use a doctype in order to ensure a better chance of the page rendering properly in multiple browsers.

Read this to see how to center a background image


12-16-2006, 04:19 AM
hmm doctype? ive not even heard of that... im very new to this whole CSS, first site ive tried to make even using Style Sheets heh, but yeah some of the images not loading is a problem, ill look into the doctypes thing thanks :)

thanks for that site, i tried out what it said, applied a top center position to the pages background but its just the same :( it doesnt follow my contents which is centered, in theory it shud hav, ive flicked thru the site and cant find what im after either.