Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Old 03-21-2009, 01:46 PM Background Gradient
Skilled Talker

Posts: 53
Trades: 0
How can you make a background gradient using CSS so that the gradient appears the same when viewed in different screen sizes?
moonlit is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-21-2009, 02:08 PM Re: Background Gradient
stevej's Avatar
Professional Multitasker

Posts: 996
Location: Not positive
Trades: 0
It's probably relatively simple code, but could you give us an example of what you'd like to do?

- Steve
__________________
if($stevej == "helpful") { $talkupation += $user_power; }
stevej is offline
Reply With Quote
View Public Profile
 
Old 03-21-2009, 02:29 PM Re: Background Gradient
Skilled Talker

Posts: 53
Trades: 0
I'm still in the planning stages of my layout but here's a brief idea of my layout:

http://www.liesldexheimerdesign.com/layout2.html

I know I could do repeat instead of repeat-x but then the gradient would display incorrectly and it will display differently for different screen sizes.
moonlit is offline
Reply With Quote
View Public Profile
 
Old 03-21-2009, 02:59 PM Re: Background Gradient
stevej's Avatar
Professional Multitasker

Posts: 996
Location: Not positive
Trades: 0
You're not going to be able to stretch the gradient, but you can take the darkest color at the bottom (which appears to be #707070) and then use the CSS like this:
Code:
background: #707070 url(http://www.liesldexheimerdesign.com/bg.jpg);
So that when the gradient ends, the darkest color continues to display.

- Steve
__________________
if($stevej == "helpful") { $talkupation += $user_power; }
stevej is offline
Reply With Quote
View Public Profile
 
Old 03-21-2009, 04:08 PM Re: Background Gradient
Skilled Talker

Posts: 53
Trades: 0
Ahhhh very clever. Thanks!
moonlit is offline
Reply With Quote
View Public Profile
 
Old 03-25-2009, 11:18 PM Scalable backgrounds ARE possible!
Novice Talker

Posts: 7
Trades: 0
Quote:
Originally Posted by stevej View Post
You're not going to be able to stretch the gradient
Actually, I found a way. Make an apdiv that serves as a background (in other words the z-index is lower than all other elements and the width and height is 100%). Then put an image inside of this div and set that image's width and height to 100%.

What's really awesome is that you can have multiple backgrounds if you want - one tiling in repetition, and another as a gradient overlay that will scale when you resize.

There, I've just shared with you the best trick in my toolbox.

View example here.
__________________
fueled by caffeine, entheogens, & breaKcore
Abusername is offline
Reply With Quote
View Public Profile
 
Old 03-26-2009, 09:40 AM Re: Background Gradient
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
Actually, I found a way. Make an apdiv that serves as a background (in other words the z-index is lower than all other elements and the width and height is 100%). Then put an image inside of this div and set that image's width and height to 100%.
Except using an AP div for that is not a good idea. You really don't want to use absolute positioning all over the place, and in this case it's just not necessary. Worse, IE has some major issues with AP and z-index. You can "layer" divs with different backgrounds fairly easily w/o using absolute positioning, I do it all the time.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Background Gradient
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.32806 seconds with 12 queries