CSS Background

M

moif

Hi Group,

I'm very new to CSS so please be gentle!

I'm starting a blog in reference to my World of Warcraft adventures and I'm
using a default blog theme that I'm hacking to pieces in Dreamweaver. If you
take a look at http://www.brightonbreaks.co.uk/blog/ you can see the start
of something that I hope will evolve into something interesting etc etc.

However, the theme I'm using is obviously CSS based (kudos to Douglas Bowman
@ www.stopdesign.com) and I'm having some issues with the code. What I want
to achieve is the background to dynamically resize in all browsers at all
resolutions. It's been a while since I used HTML or even looked at CSS and I
was wondering how this can be achieved.

I'm running a resolution of 1280 x 960 and the bg image is 800 x 600. It
appears to be short off the bottom by an inch or which makes sense. Would I
have to increase the size of the bg image and then force a shrink for any
browsers that are running at a lesser res?

TIA for any help / pointers.
 
A

Andy Dingley

What I want to achieve is the background to dynamically resize in all browsers at all
resolutions.

You can't (practically, or with CSS alone).

Set the background colour to be an innocuous colour lifted from the
image,
background-color: #006600;

maybe set the "real" background image to be left-aligned rather than
centred (probably not necessary in this example though), and just let a
solid colour border fill in the gaps .

Or else do something clever with aligning the horizons on each side and
then change
background-repeat: no-repeat;
to
background-repeat: repeat-x;
for an infinitely wide forest

If you want to be clever (always risky) place your "real" background
unrepeated into a <div> that you use for content and have the background
of the <body> replaced by a repeating image of simple sky/grass/horizon.

Now given the target audience, they're going to have broadband and big
screens. So 100k for a bgimage isn't out of line. But for normal web
use, compress the hell out of it and get it under 25k.
I'm running a resolution of 1280 x 960 and the bg image is 800 x 600. It

It's actually 1024 x 768 - that should be plenty big enough, just with a
mid-green canvas to it.
 
M

moif

Andy said:
You can't (practically, or with CSS alone).

Set the background colour to be an innocuous colour lifted from the
image,
background-color: #006600;

maybe set the "real" background image to be left-aligned rather than
centred (probably not necessary in this example though), and just let
a solid colour border fill in the gaps .

Or else do something clever with aligning the horizons on each side
and then change
background-repeat: no-repeat;
to
background-repeat: repeat-x;
for an infinitely wide forest

If you want to be clever (always risky) place your "real" background
unrepeated into a <div> that you use for content and have the
background of the <body> replaced by a repeating image of simple
sky/grass/horizon.

Now given the target audience, they're going to have broadband and big
screens. So 100k for a bgimage isn't out of line. But for normal web
use, compress the hell out of it and get it under 25k.


It's actually 1024 x 768 - that should be plenty big enough, just
with a mid-green canvas to it.

Hey great, thanks for all the advice! Defiantely some things there for me to
chew over. Oh and the BG is being reduced to a gif as we speak.

Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top