|
|
|
|
A fake gradient website background with CSS
You will learn how simple it is to apply a gradient background created using Photoshop or Gimp to a website using CSS.
|
|
 |
|
|
|
|
|
 |
|
 |
|
 |
 |
1.
|
|
|
Using your favorite web code editor such as Notepad++ or Adobe Dreamweaver, create a new style.css document and enter/paste the following code:
body{ background: url('gradient_background.jpg'); background-size: 100% 100%; background-attachment: fixed; }
Where gradient_background.jpg is an image you want to use for a gradient background.
To create your own gradient background image I recommend one of these two tutorials:
|
|
|
2.
|
|
|
In the index.html document enter the following code before the </head> tag:
<link rel="stylesheet" href="styles.css" />
Make sure you save the index.html, styles.css and your background image in the same folder on your web server, otherwise you will need to change the paths in the code.
Also recommended:
|
|
|
3.
|
|
|
In case of any questions or to let me now it worked or didn't work for you simply drop me a comment.
|
|
|
 |
 |
 |
|
 |
|
|