![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Web Design & Programming Discussion of web design, and server-side & client-side scripting |
![]() |
|
|
Thread Tools |
|
|
#1 (permalink) |
|
Registered User
|
[Solved]Expandable Background
I have a background image that is a simple gradient black to gray, I want it to be able to stretch no matter what screen size to fit the background with no scroll bars. I am using Visio Studio and I have Dreamweaver CS3 can someone explain this to me? I could see if I split it in three colums but what about height wise it gets me really confused. I know Id have to use .css file someone please help out! Thanks ![]() |
|
|
|
|
|
#2 (permalink) |
|
Design Team Member
Join Date: Jul 2007
Location: Northampton, UK
Posts: 1,090
OS: Win Vista Home Premium & Ubuntu Hardy(8.04)
|
Re: Expandable Background
Hey, is the gradient verticle or horizontal... either way this would work(you'd just have to modify it if the gradient is horizontal[but that's as easy as changing an x to a y):
within your html file you could add this code(within the head section of the page[if you don't know how to write html/css i highly suggest you learn[if you have the time], there are some great tutorials here: www.w3schools.com ): Code:
<style type="text/css">
/*Adds the style to the body element of the page */
BODY{
/*This adds the image to the page, myimage.jpg should be replaced with your image's name*/
background-image: URL("myimage.jpg");
/*This "Repeats" the image along the x axis(horizontally, change "x" to "y" if the gradient is horizontal)*/
background-repeat: repeat-x;
}
</style>
Jamey |
|
|
|
|
|
#3 (permalink) |
|
Registered User
|
Re: Expandable Background
what if the image is not big enough to cover vertically? Will it stretch? Because I have a gradient that is vertical fading black to gray and I want it to be able to be used by everyone... Is there a perticular size that I should make the graident or will it stretch?
|
|
|
|
|
|
#4 (permalink) |
|
Design Team Member
Join Date: Jul 2007
Location: Northampton, UK
Posts: 1,090
OS: Win Vista Home Premium & Ubuntu Hardy(8.04)
|
Re: Expandable Background
hey, when i've done this before i've used a gradient from say #000000(black) to #AAAAAA(light grey) and then set the background colour (which would go behind the image) as #AAAAAA so that when the gradient runs out it's just the solid colour...
So the code is something like: Code:
background-image: URL("background.jpg");
background-repeat: repeat-x;
background-color: #AAA;
Cheers, Jamey p.s. i don't think theres an actual way to stretch the image. |
|
|
|
![]() |
| Thread Tools | |
|
|