Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please Help

Status
Not open for further replies.

sandsandwichwich

Programmer
Aug 10, 2007
2
CA
Could someone please tell me how to use a gradient background in dreamweaver, i made one in photoshop and inserted it into dreamweaver but it is not aligned and when i view the page in a browser you can see lots of white on the left, top, bottom, and right of the page.

How do I center it and get rid of the white areas.

Thanks So Much.
 
Background image for what? For the page? For a div?

You could make a really large image and center it with css like:
Code:
...    background-repeat: no-repeat;
    background-position: center;
...

Make sure you remove the margin and padding to remove your whitespace. This may involve a very large graphic.

A better solution is to set the background color to the color of the faded gradient and apply the background the top of the page only. That way it will fade from the top down seamlessly into the background color. (This assumes a vertical gradient.) e.g.
Code:
...
background: url('yourimage.gif') #fff repeat-x 0 0;
...


Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top