Jump to content

Recommended Posts

I am trying to make my background in a wordpress site auto size to full screen. I am having no luck at all doing so.

 

Here is the original code, i did take out the Top BG because i only want one image to auto size to the full web browser with out repeats.

 

/* CSS Tweaks */

* {padding:0;margin:0;}

a img {border:0;}

.clear {clear:both;}

a {text-decoration:none;}

a:hover {text-decoration:underline;}

p {padding-bottom:10px;}

.hidden {display:none;}

 

/* Body */

body {background:url(img/bg.gif) 4px 5px;font-family:Arial;font-size:12px;}

 

/* Top BG */

.topbg {position:absolute;top:0;left:0;width:100%;height:260px;background:url(img/top_bg.gif) repeat-x top;z-index:1;}

 

/* Wrapper */

.wrapper {position:relative;width:960px;margin:auto;z-index:2;}

You need to define width:100% on your body (assuming this contains your bg image?). Do not forget to also call width:100% on html as % only works if your parent has a width declared.

 

If that doesn't work, try removing the  * {padding:0;margin:0;} under tweaks.

I tried doing this and many other techniques and they all failed. The image keeps repeating. When i put no-repeat it in the image still does not auto adjust

 

/* CSS Tweaks */

*

a img {border:0;}

.clear {clear:both;}

a {text-decoration:none;}

a:hover {text-decoration:underline;}

p {padding-bottom:10px;}

.hidden {display:none;}

 

/* Body */

body {width:100%;height:100%;background:url(img/bg2.gif);}

 

 

 

/* Wrapper */

.wrapper {position:relative;width:960px;margin:auto;z-index:2;}

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.