Articles Tutorials Work at Home Entrepreneurs, Webmasters, Small Business Owners
Articles Tutorials Work at Home Entrepreneurs, Webmasters, Small Business Owners
Articles & Tutorials for Work at Home Entrepreneurs
Webmasters and Small Business Owners
Get More >

Newest Articles 
Search Engine Marketing
Internet Marketing
Affiliate Marketing
Email Marketing
Viral Marketing
Webmaster Resources
Business Resources
Make More Money
CSS
Web Design
Graphic Design
Color Theory
Product Reviews
Time Management
Business Ethics
Promotional Strategies
Glossary of Terms
Direct Mail Marketing
Telemarketing
Product Sourcing



Link to Us!

CSS
Email this article  :  Printer friendly page

Relative and Absolute Paths in Style Sheets

If you use relative paths in your style sheet, Netscape 4.x will incorrectly interpret the paths as being relative to the HTML document to which the style sheet is linked instead of being relative to the style sheet itself. This will work fine if your style sheet is in the same directory as the HTML page, but if you linked your external style sheet to any HTML documents in a different directory, then none of the relative paths will be correct.

If this concerns you because you have a number of visitors coming to your site who still use the ancient version of Netscape 4.x, then you might want to consider using absolute paths instead. Or for smaller sites that do not have directories, move the location of your style sheet to the same directory as your HTML pages (most likely under the root: http://www.yoursite.com/mainstyle.css.

What do absolute paths look like within the style sheet?
body { background-image: url("http://www.yoursite.com/graphics/back.gif");}

What do relative paths look like within the style sheet?
body { background-image: url("/graphics/back.gif");}

Hot Webmaster TipOne way to easily remember the difference between absolute and relative paths is to think of absolute as being an absolutely sure way to get to the file if you typed the entire string into your browser address bar.

Copyright © 1994-2006 by BasicTips.com, a division of BasicTemplates.com, CSS HTML Web Site Templates with Exernal CSS and Removable Graphics. If you found our articles helpful, subscribe to our newsletter and get articles like this delivered to your inbox - FREE.

Order soon and get up to 5 FREE domains & more!
Host 6 Domains on 1 Account
5000MB and 400GB for $6.95 a month!

 

Page copy protected against web site content infringement by Copyscape
All articles are originally authored by BasicTemplates.com. Reprints in whole or in part are not permitted. See Copyright Notice

Copyright © 1994-2006 BasicTips.com, a division of BasicTemplates.com, Web Site Templates with External CSS
The Internet's #1 Choice for HTML CSS Web Templates via a Membership. Designed using External CSS and Removable, Swap-Out Graphics.
Basic Web Templates | Website Templates | HTML CSS Templates | Web Design Templates | Web Site Templates