0

I have recently started to get back into website development and I know for external style sheets you do

<link rel="stylesheet" type="text/css" href="main.css">

for when the website is local to your computer but how would someone use external stylesheet if the website were to be made public and put on a hosting site such as godaddy.com? One example I found was from google docs:

<link href="//docs.google.com/static/document/client/css/1823751902-KixCss_ltr.css" type="text/css" rel="stylesheet">
5
  • What's the question?
    – Pete TNT
    Nov 21, 2014 at 17:48
  • this should work ..just use http: in front of href="//docs.google..."
    – Riad
    Nov 21, 2014 at 17:50
  • Not clear with the question.. Nov 21, 2014 at 17:52
  • what i want to do is use external style sheets with a website that is accesible to the public but i am unsure of how use external style sheets with websites that are accesible via world wide web Nov 21, 2014 at 17:53
  • it should be fine as it is. what exactly is the problem you are facing? Load it on an html page in the browser, then view source and click on the link to confirm if it opens the css file
    – Don Barry
    Nov 21, 2014 at 17:54

2 Answers 2

1

There are two types of path you can use.

One is relative and another is absolute. Relative path is located in your server and absolute path can be anywhere in the internet.

look here for more information

0

if you are hosting your stylesheets on the server where you website is, generally you put your stylesheets in the same folder(or subfolder) where your index.html page is and provide a relative links on the pages you want your stylesheet to work on. for e.g

 href="style.css" (if in the same folder as index.html) or
 href="subfolder/style.css" ( if in a subfolder)

if you are hosting your stylesheet or using a third party stylesheet then put a complete link as it would appear on the address bar of the browser.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.