Why <link rel="stylesheet" href="/css/master.css" media="screen" title="no title" charset="utf-8">


Hi I’m new to code and I just made a new html doc and in the head element I typed <link
I then hit the tab button and atom filled in the rest.

When linking a css doc to an html doc so far I have been told to type in

href="style.css" type=text/css> Though I don't quite understand the type="text/css yet. Could you explain this?

Could you also explain the other stuff that atom autofilled?
I’m sure it’s not a mistake. I just want to understand why all of that stuff is there.


It’s my understanding that the snippets included in various packages, including the language-html package, were included for one of the following reasons:

  • They were in the package that the Atom package was converted from
  • The author thought they were useful
  • They are standard snippets in other editors

I can’t answer which of those were the motivators for that particular snippet. You can always override that snippet, or any snippet, using your snippets.cson.


Ok cool thank you I’ll look in to how to do that. :slightly_smiling:


It’s just more precise. When standard bodies design the convention there’s some hook to better future-proof / extend the standard.

It’s like you can specify <script type='text/javascript'> or just use <script> and it’s understood to be javascript by default. I think old version of IE also supported vbscript.


So why does it default the href to “/css/master.css”?
I’ve only learned to link to folders via “css/master.css” or “…/css/master.css”.
Is “/css/master.css” a bug or is there something I’m not getting, here?


Quoting myself, how gauche.