66

Am I the only one that can't remember how to link a CSS file in HTML? I must copy/paste every time from an other project :(
<link rel="stylesheet" type="text/css" href="main.css">

Comments
  • 6
    I copy pasta the whole head usually, but I'm laaaaazy
  • 2
    I Google it everytime :) faster then typing it anyway :p
  • 1
    The type attribute isn't mandatory. So it can be easier to remember : <link rel="stylesheet" href="path" />
  • 2
    I'm also embarrassed to say how long it took me to get that one down. Now that I have it down, I work primarily on the back end... Or I have a build process but in the link tag for me.
  • 0
    I'm with @humanbonsai I wind up copying the whole head and adjusting as needed most of the time. I'm using the same several scripts/css files across the project so I might as well use the same head rather than type it up again.
  • 0
    you probably want to use emmet instead, no one has time to remember this shit
  • 1
    Or use snippets. Snippets are awesome. Some on here dislike Atom but I like it and it handles snippets well.
  • 0
    @Djeisen could you tell us more about that?
  • 2
    @lucas22 on Atom and a few other editors, you can save snippets. Then, you can type in something like "css" and tab and it will fill in the thing that you saved. And it will place the cursor at the right place to let you edit the href, if you make the snippet correctly.
  • 2
    @lucas22 or Emmet, type link, press tab, boom done ! plugins available for almost any text editor or ide, writing html becomes a joy (formerly known as zen coding)
Add Comment