VirtualMV/CSS/Techniques/Gradient filled background
From WikiEducator
< VirtualMV | CSS | Techniques
Cascading Style Sheets | ||
---|---|---|
Overview | Inline, embedded, linked | Language | class and id selector | Example | Help Desk ( Interactive ) | |
Formatting | Span | Text | Devices | |
Layout | Block centering | | |
Techniques | Navigation | Gradient filled background | Other |
Objectives
To create a gradient filled background
Create a gradient strip
In image in a drawing program create an image that is say 20 pixels wide and height of 450px e.g. BackGradientGreen.png (in downloads below)
Tip make sure the final fill colour is the same as your default background colour (in the example this is white) that way it will always look right no matter what height the browser is set to.
Add the following style
<style type="text/css"> body { background-image: url('BackGradientGreen.png'); background-attachment: fixed; background-repeat: repeat-x; } </style>
Notes
background-attachment (Refsnes Data, 2008)[1]
- Scroll: Default. The background image moves when the rest of the page scrolls
- Fixed: The background image does not move when the rest of the page scrolls
Downloads
Green Blue Fuschia Grey (Right click and save to your drive)
Links
- ↑ Refsnes Data(2008).CSS background-attachment Property. Retrieved November 15, 2008 from http://www.w3schools.com/Css/pr_background-attachment.asp
References
virtualMV | Superquick wiki guide | Please give me some feedback |
VirtualMV/CSS/Techniques/Gradient filled background. (2024). In WikiEducator/VirtualMV wiki. Retrieved November 21, 2024, from http:https://wikieducator.org/VirtualMV/CSS/Techniques/Gradient_filled_background (zotero)
|