Forum Moderators: open

Message Too Old, No Replies

Background Formatting

Background Formatting

         

dnelsalty

2:13 am on Sep 20, 2009 (gmt 0)

10+ Year Member



Okay...

I am using HTML and I am trying to make the background fit to the monitor. I want it so that it fits all computers and does not tile. Here is the code.

<url removed>

I am helping a friend make his first site.


<center>
<div id="contain">
<div id="leftcol">
<p><body background="zBackground2.jpg" bgproperties="fixed" alink="#ffffff" link="#ffffff" vlink="#ffffff" background-repeat: no-repeat; background-align: center;></p>
</div>
<div id="rightcol">
<p></p>
</div>

[edited by: incrediBILL at 2:20 am (utc) on Sep. 20, 2009]
[edit reason] removed URL, see TOS #13 [webmasterworld.com...] [/edit]

D_Blackwell

2:51 am on Sep 20, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld.

1) The personal link is going to get chopped, but it's not personal. (LOL - What a fun place you've found.)

2)

....trying to make the background fit to the monitor. I want it so that it fits all computers and does not tile......

2-A) You are using a single image as a full page background. This is okay (sort of). You can do that, but I generally recommend against single image full page backgrounds as a bad idea. Image backgrounds tend to be too busy, too distracting to the content. File size can be an issue as well.

2-B) Which isn't to say that I have not done that myself - always with a good reason. It needs to be large enough to accommodate the largest resolution that you expect a user to have. One of the monitors in front of me is 1600 x 1200. True, I've got about four apps open on this monitor alone and this browser is using about one-third of that, but you see where I am going. The background-image: usually works best positioned dead center; though I grant that this depends on the image.

2-C) If the image is tiling, it is too small. Simple as that. "Fits all computers....." means that it needs to be pretty big, as noted above.

3) You should select a W3C - Valid DTD List [w3.org] Might a suggest a delightful HTML 4.01 Strict as a fine selection. Validate HTML and CSS [w3.org] as a 'best practice'.

4) You are using deprecated attributes, which is begging for big trouble:

alink and vlink are deprecated.

bgproperties is deprecated and was good on IE only I believe.

background-align - I don't know if it even existed.
........................

5) The background should be declared as follows:

<body style="background-image: url(zBackground2.jpg);">
~ ~ ~ ~ ~

Better is:

<body style="background: #feaebd7 url(zBackground2.jpg);">

where the color declaration comes close to matching the background-image: - The color will render first. If the image is late showing up, the POP will be a lot less severe if the page background is set at a complementary color.

That's enough to start with. Search - W3C CSS - You'll learn a lot there; lots of resources. w3.org is more academic and technical. w3schools.com is a quicker way to see how things should work. Study both.

tangor

3:16 am on Sep 20, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



One can get the monitor resolution, but getting the WINDOW size is something else. The vast majority of these "full screen image" ideas fail simply because few folks run their browsers full screen.