Reputation: 11
When you link your stylesheet to your document
<link type ="text/css" rel ="stylesheet" href="stylesheet.css"/>
why don't you put a semicolon after each attribute, when you put a semicolon after each attribute when doing something like inline styling e.g.
<p style="font family:Arial; color:yellow; etc
?
Upvotes: 1
Views: 1907
Reputation: 7374
Attributes in HTML are not the same as properties in CSS. They are completely different languages and therefore have completely separate syntaxes. In HTML you're creating a link. In CSS you're creating a property: value;
pair.
When you put style inline, as per your second bit of code, you're basically telling the browser that you're writing CSS and that it needs to parse it as such. In doing so you then have to use CSS syntax, not HTML.
Upvotes: 6