Simple Machines Community Forum

General Community => Scripting Help => Topic started by: Acf on November 01, 2003, 03:34:55 PM

Title: How do i valign a background?
Post by: Acf on November 01, 2003, 03:34:55 PM
I am trying to make a background width 100% with no repeat and valigned at the bottem... :-[
i have  been trying all day now and cannot seem to get it work :'(
**Removed**

Does anyone know how to do this?

*acf
Title: Re:How do i valign a background?
Post by: [Unknown] on November 01, 2003, 03:53:53 PM
background-position (http://www.w3schools.com/css/pr_background-position.asp)

-[Unknown]
Title: Re:How do i valign a background?
Post by: Acf on November 01, 2003, 03:58:51 PM
.top {

border : 0px; 

width : 100%;

background-repeat: no-repeat;

background-position: 0% 0%;

background : url(
**removed**
);

}

ive tried that but it didn't seem to work :(
Title: Re:How do i valign a background?
Post by: [Unknown] on November 01, 2003, 04:36:13 PM
I would use background-position: top top; backgrund-repeat: no-repeat;...

Also, since background is a shorthand property, you have to put it before the other two.

-[Unknown]
Title: Re:How do i valign a background?
Post by: Acf on November 01, 2003, 04:48:17 PM
Thanx unknown that seemed to work :)

.top {

border : 0px; 

width : 100%;

background : url(
**removed**
);

background-position: bottom bottom;

background-repeat: no-repeat;

}

only now i have to find how to get the background to span 100% of the cels :)
Title: Re:How do i valign a background?
Post by: [Unknown] on November 01, 2003, 04:52:05 PM
background-position: bottom left;
background-repeat: repeat-x;

-[Unknown]
Title: Re:How do i valign a background?
Post by: Acf on November 01, 2003, 04:57:30 PM
Quote from: [Unknown] on November 01, 2003, 04:52:05 PM
background-position: bottom left;
background-repeat: repeat-x;

-[Unknown]

thanx :D you just made my day :)
Title: Re:How do i valign a background?
Post by: SparkieGeek on November 01, 2003, 05:16:03 PM
Instead of using the general background property, you should use background-image: url(blahblah) :)
Title: Re:How do i valign a background?
Post by: Acf on November 02, 2003, 06:48:39 AM
Quote from: SparkieGeek on November 01, 2003, 05:16:03 PM
Instead of using the general background property, you should use background-image: url(blahblah) :)

Its valid so why change it?
Title: Re:How do i valign a background?
Post by: Tyris on November 02, 2003, 07:11:28 AM
I think for general purpose you'd use background-image...
coz the background command sets the image to blah or whatever, and everything else to 0 or null... then they are overwritten... it works tho.
Title: Re:How do i valign a background?
Post by: Acf on November 02, 2003, 07:20:50 AM
Quote from: Tyris on November 02, 2003, 07:11:28 AM
I think for general purpose you'd use background-image...
coz the background command sets the image to blah or whatever, and everything else to 0 or null... then they are overwritten... it works tho.

I did now that but if you are not using a background collor in the same css it doesnt matter what i use.

(
**removed**
l freaking wierd css test i made a while ago :P )
Title: Re:How do i valign a background?
Post by: SparkieGeek on November 03, 2003, 06:59:42 AM
Quote from: </Acf> on November 02, 2003, 06:48:39 AM
Quote from: SparkieGeek on November 01, 2003, 05:16:03 PM
Instead of using the general background property, you should use background-image: url(blahblah) :)

Its valid so why change it?

You're right, it is valid, and will work just fine. I guess I was just trying to make you aware of background-image.

/me thought using background-image was more consistent with the rest of your background CSS code
If you wanted you could of course use the background property to set all of the properties in one line like this..

background: url(http://www.theclash.zenid.net/aliencowfarm/catbg3.jpg) repeat-x bottom left
Title: Re: How do i valign a background?
Post by: Acf on November 03, 2003, 12:26:56 PM
hmm that one line code looks cool :P might use it some time :)