CSS & backgrounds - why isn't this working?

Show off new creations, get help, or just chat about all aspects of web development and design.

CSS & backgrounds - why isn't this working?

Postby dissonance on Fri Apr 04, 2008 5:19 pm

Code: Select all
body {
    margin: 0px;
    font-family: sans-serif;
    background-color: #b8cfe6;
    background-image: url('effects/bottomgradient.png');
    background-position: top left;
    background-attachment: fixed;
    background-repeat: repeat-x;
}

bottomgradient.png is a 2x1200 strip of white with the last 96 pixels being a gradient from white to transparent.
I'm trying to make the background blueish, then use the gradient to create a blue to white fuzzything on the bottom of the screen,* but the background comes out as pure white.

edit: w3c's css validator tells me my code is well-formed, so it's not a syntax error.
Blink! Halp!

*In before "why not just make a blue to white image?" I'm doing it this way so I only have to change one or two values in my stylesheet to get an entirely new colorscheme.
i had fun once, and it was awful.
User avatar
dissonance
Veteran
Veteran
 
Joined: Wed Oct 10, 2007 12:35 am
Location: usa

Re: CSS & backgrounds - why isn't this working?

Postby zombie@computer on Fri Apr 04, 2008 5:49 pm

got an example online?
When you are up to your neck in shit, keep your head up high
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Re: CSS & backgrounds - why isn't this working?

Postby dissonance on Fri Apr 04, 2008 5:52 pm

zombie@computer wrote:got an example online?
No, I don't, but here's the image in question just in case you'd like to try it.
Attachments
bottomgradient.png
bottomgradient.png (268 Bytes) Viewed 8353 times
i had fun once, and it was awful.
User avatar
dissonance
Veteran
Veteran
 
Joined: Wed Oct 10, 2007 12:35 am
Location: usa

Re: CSS & backgrounds - why isn't this working?

Postby zombie@computer on Fri Apr 04, 2008 5:58 pm

well, the image is 100% white for me, so that would be a good reason for this not to work. :P
When you are up to your neck in shit, keep your head up high
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Re: CSS & backgrounds - why isn't this working?

Postby vcool on Fri Apr 04, 2008 6:00 pm

same here - the image is white.
Image

Neighborhood Forum Elitist
User avatar
vcool
Veteran
Veteran
 
Joined: Fri Jun 23, 2006 1:03 am
Location: USSR

Re: CSS & backgrounds - why isn't this working?

Postby dissonance on Fri Apr 04, 2008 6:22 pm

zombie@computer wrote:well, the image is 100% white for me, so that would be a good reason for this not to work. :P
Really?
It's a single layer, and this is what it looks like in Gimp. What are you using to view it?
Attachments
2008-04-04-111810_1920x1200_scrot.jpg
2008-04-04-111810_1920x1200_scrot.jpg (49.36 KiB) Viewed 8333 times
i had fun once, and it was awful.
User avatar
dissonance
Veteran
Veteran
 
Joined: Wed Oct 10, 2007 12:35 am
Location: usa

Re: CSS & backgrounds - why isn't this working?

Postby zombie@computer on Fri Apr 04, 2008 6:23 pm

firefox, ie, opera: all white
When you are up to your neck in shit, keep your head up high
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Re: CSS & backgrounds - why isn't this working?

Postby dissonance on Fri Apr 04, 2008 6:30 pm

Open it in Photoshop or something and lemmie know if it's still white. Browsers have white backgrounds and not checkered ones.
i had fun once, and it was awful.
User avatar
dissonance
Veteran
Veteran
 
Joined: Wed Oct 10, 2007 12:35 am
Location: usa

Re: CSS & backgrounds - why isn't this working?

Postby theblahman on Fri Apr 04, 2008 8:48 pm

Just opened it in photoshop and it's pure white. No gradients.. just white.

Might want to check your saving method.
I design (v4.1 released 23/2) and Tweet.
User avatar
theblahman
May Contain Skills
May Contain Skills
 
Joined: Sun Jan 15, 2006 3:55 am
Location: Australien

Re: CSS & backgrounds - why isn't this working?

Postby dissonance on Fri Apr 04, 2008 9:53 pm

theblahman wrote:Just opened it in photoshop and it's pure white. No gradients.. just white.

Might want to check your saving method.
Hmm, will do.
i had fun once, and it was awful.
User avatar
dissonance
Veteran
Veteran
 
Joined: Wed Oct 10, 2007 12:35 am
Location: usa

Re: CSS & backgrounds - why isn't this working?

Postby 904 on Fri Apr 04, 2008 10:30 pm

You might not want to do this, since IE is generally very sloppy with transparent PNGs.
904
Design Section Moderator
 
Joined: Tue Aug 30, 2005 9:26 pm
Location: Gitmo-nation Lowlands

Re: CSS & backgrounds - why isn't this working?

Postby dissonance on Fri Apr 04, 2008 10:56 pm

904 wrote:You might not want to do this, since IE is generally very sloppy with transparent PNGs.
Well, this page/site is going to be running only on a private darknet, so i can make firefox/opera/konqueror/epiphany mandatory.
Otherwise, though, yeah... you're right.
i had fun once, and it was awful.
User avatar
dissonance
Veteran
Veteran
 
Joined: Wed Oct 10, 2007 12:35 am
Location: usa

Re: CSS & backgrounds - why isn't this working?

Postby dissonance on Fri Apr 04, 2008 11:47 pm

Yeah, that was it. I really don't know what went wrong the first time I tried saving it, but thanks to everyone who helped out.

edit: screenshot attached.
edit 2: yeah, that's right, that's /fa/. no, that doesn't make me a fag.
Attachments
2008-04-04-164839_1920x1200_scrot.jpg
(90.26 KiB) Downloaded 27 times
i had fun once, and it was awful.
User avatar
dissonance
Veteran
Veteran
 
Joined: Wed Oct 10, 2007 12:35 am
Location: usa

Re: CSS & backgrounds - why isn't this working?

Postby Blink on Sat Apr 05, 2008 6:43 pm

Just so you know, you can shorten:

Code: Select all
body {
    margin: 0px;
    font-family: sans-serif;
    background-color: #b8cfe6;
    background-image: url('effects/bottomgradient.png');
    background-position: top left;
    background-attachment: fixed;
    background-repeat: repeat-x;
}


to:

Code: Select all
body {
    margin: 0;
    font-family: sans-serif;
    background: #b8cfe6 url('effects/bottomgradient.png') repeat-x top left;
    background-attachment: fixed;
}


:-)
User avatar
Blink
Cool 'n that
Cool 'n that
 
Joined: Fri Oct 08, 2004 4:16 pm
Location: UK

Re: CSS & backgrounds - why isn't this working?

Postby Rakkerzero on Mon Apr 28, 2008 12:28 pm

If you want use only 1 backgroundcolor with a gradient up on it i suggest to use a simple non-tranparancy PNG or JPG with a gradient from white to the preferred blue color. This always works and you don't have to 'mess' with PNG transparency.

If you want to use a backgroundimage with a gradient up on it i suggest to look to this webpage: click here. It has the information you need on this subject.

Good luck.
User avatar
Rakkerzero
Member
Member
 
Joined: Mon Apr 18, 2005 7:27 pm
Location: Netherlands

Return to Web Design & Development

Who is online

Users browsing this forum: No registered users

cron