| Web Business Forms |
| Colour Chart |
| Color Impact |
| CSS Editing Tools |
| Search Engine Tips |
| DW/FW Tutorials |
| Submit Your Site |
| Useful Links |
| RSS News Feeds |
| Site Map |
| Contact Us |
![]() |
![]() |
| Page 1| Page 2 | Page 3 | Page 4 | Template Packages | Template Sale |
RESOURCES :: Mini Tutorials:: Page Margins and page backgrounds using CSS |
This started out as a bit of advice for a forum poster who wasn't sure how or whether to implement a gradient image as a page or table background. I thought I would expand on the idea to include page margins. You need to set margin and padding properties to 0 to remove the default margins of your page. Implementing various css techiques we can vary how an image can be used as a page background. Using an image as a background for your pages:I used Fireworks to design the gradient image you see above. I started with an image 1030px x 20px. (This is what you see below). This was used for the vertical repeat demo, however for the horizontal repeat demo, I increased the height of the image to 100px so that it sat 100px down from the edge of the window. Change the graphic size to suite your layout. It is a simple rectangle with a linear gradient using colors #A5ACE2 to #660000. I also changed the opacity setting for the purple colour. The graphic was exported as a jpg. We have also added a margin declaration to our stylesheet so that the image sits 'flush' with the browser window and does not show the default browser margins. Use in your stylesheet:To get completely valid code that works for all browsers in any version of DW, use the following in your stylesheet. body { Use this in your document head:If you prefer to add this to your document, copy and paste the following into the head of your document: <style type="text/css"> By changing the background-repeat declaration, we can have the background running horizontally or vertically on a page. Example of fixed background image-----> (background-attachment: fixed) Example of a shadow effect background repeating down the page -----> (background-repeat: repeat-y)
|
| Templates | Nav Bars | Free Downloads | Resources | Ecommerce | Books | SEO | RSS Feeds | Contact Us | |
|
Dreamweaver Resources is owned & operated by Nadia Perre of PerreLink Web Solutions PO Box 250 Fairy Meadow (Wollongong) 2519 NSW Australia Copyright © 2003 - 2007 PerreLink Web Solutions |