?
Solved

Background Gradient

Posted on 2003-03-20
9
Medium Priority
?
507 Views
Last Modified: 2011-04-14
How could I go about making a gradient background for my webpage? I would like it to start off with the colour #989489 and end with #C7C4BB. Does anyone know how to simulate one that would fill the whole page?
0
Comment
Question by:momonja
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +3
9 Comments
 
LVL 30

Expert Comment

by:third
ID: 8178746
an image can easily do that. create a 1 pixel width image (the height should depend on the screen size you want) then set it as horizontally repeating (repeat-x) background image of your page.
0
 
LVL 10

Expert Comment

by:kollegov
ID: 8178981
This is IE only solution...
What you are asking for is impossible to do in other browsers unless you do tiled gradient image

<style>
  .bg {
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:#989489;
    filter: alpha(OPACITY=100,FINISHOPACITY=0,STARTY=0,STYLE=1,STARTX=0,FINISHX=0 );
    z-Index:1;
  }
  .content {
    position:absolute;
    top:0;
    left:0;
    z-Index:10;
  }
</style>


<body bgcolor="#C7C4BB">
<div class="bg"></div>

<div class="content">
  Put page content here  
</div>


</body>
0
 
LVL 5

Expert Comment

by:pmsyyz
ID: 8179321
IE only solutions suck and keep your CSS from validating.

Currently, a one pixel tall, very wide background image is your only option.

In a few years you can set your background to be an SVG image to get your desired effect, since SVG support gradients.
http://www.w3.org/TR/SVG11/pservers.html#Gradients
Example: http://www.w3.org/TR/SVG11/images/pservers/lingrad01.svg
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

Author Comment

by:momonja
ID: 8189471
isn't there any better way...?
0
 
LVL 30

Expert Comment

by:third
ID: 8191953
if you want to support x-browser then my suggestion which is a gradient image is your only choice.
0
 
LVL 6

Expert Comment

by:jwenting
ID: 8194506
Gradient image is the only crossbrowser solution as long as IE is the only browser that is (almost) fully CSS2 compliant.
0
 

Author Comment

by:momonja
ID: 8442576
oh well... thanks i guess...
0
 

Expert Comment

by:modulo
ID: 8447188
Dear expert(s),

A request has been made to close this Q in CS:
http://www.experts-exchange.com/Community_Support/Q_20603255.html

Without a response in 72 hrs, a moderator will finalize this question by:

 - Saving this Q as a PAQ and refunding the points to the questionner

When you agree or disagree, please add a comment here.

Thank you.

modulo

Community Support Moderator
Experts Exchange
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 8462778
Saving this Q as a PAQ and refunding the 40 points to the questionner

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question