I am in the process of learning HTML.
What is the best way to create a gradient background for an HTML page?
So far this is what I have as a background:
body style="background-color:Powderblue"
I know this is not a gradient.
I am in the process of learning HTML.
What is the best way to create a gradient background for an HTML page?
So far this is what I have as a background:
body style="background-color:Powderblue"
I know this is not a gradient.
It's not possible to make a gradient with HTML alone. There are new features in CSS3 which allow you to create a gradient, however these are not fully supported by all browsers.
If you'd like to read some more about CSS3 gradients, read this article
There is also a handy online tool which will create the CSS code to create a gradient of your specification, here.
Use this http://www.colorzilla.com/gradient-editor/
CSS should be applied in a separate stylesheet... never apply styling inline.
There are many online tools that create Gradients. Either you can use them or you can create your own
Also you can create your own by this way
CSS
This cannot be done in html but it can in css (specifically css3).
You would have to add a class to the body of your page or a div within it that surrounds all of your content. You can use a css gradient generator to get the code to put in your css class.
Here is a simple example on a div: http://jsfiddle.net/8fDte/
You can do the following as well if you want it on the body. Note you have to link to the css file that will store you styles.
HTML
CSS
This code can be generated by a css gradient generator like the one linked above.
Edit:
As Rory mentioned, CSS3 is not fully supported by all modern browsers. However, there are some tools such as PIE CSS to help IE to accept some CSS3 functionality.
Styling in external sheets is a much easier, faster and more efficient way to style your web pages especially if you have several pages that link to your style sheet(s). This allows you to change the entire styling of all of your pages at the same time with one line of code. It is ok however if you have a single page that you have up or if you need a simple page to look different by itself, inline styling is sufficient but not common. See below for quick example.
(inline styling for each page)
....or it would b like this
and your "yourcssheet.css" style sheet would look like this
Now instead of going through every style on each individual page head, you can simply change it all with a simple external sheet all linked together by the following.
Hope this helps. jhawk2k14@gmail.com