What are the pros and cons of each? Is there a difference?
CSS Stylesheets in HTML.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I assume you’re asking which of these you should use:
The difference between the two is that the former is called a relative path and the latter is an absolute path.
If the HTML page in question is
http://example.com/page.html, then there effectively is no difference. However, if the page ishttps://example.com/page.html(SSL secured), you’ll find that there is now a very important difference. On a secured page, many browsers will not load content which is not also served securely. If you’ve linked your CSS file with an absolute path, it would not be served securely and therefore your stylesheet might not get loaded.Unless you have a very specific reason to link your CSS absolutely, you want to use a relative path.