Document-level style sheets appear in the head of the document External style sheets are in separate files, potentially on any server on the Internet Written as text files with the MIME type text/css Linking an External Stylesheet A <link> tag is used to specify that the browser is to fetch and use an external style sheet file <link rel = "stylesheet" type = "text/css" href = ""> </link> - External style sheets can be validated validator-upload.html Style Specification Formats Format depends on the level of the style sheet Inline: Style sheet appears as the value of the style attribute General form: style = "property_1: value_1; property_2: value_2; … property_n: value_n" Format for Document-level Style sheet appears as a list of rules that are the content of a <style> tag The <style> tag must include the type attribute, set to "text/css" The list of rules must be placed in an HTML comment, because it is not HTML Comments in the rule list must have a different form - use C comments (/*…*/) General Form, Document General form: type = "text/css"> <!-- rule list --> </style> Form of the selector {list of property/values} Each property/value pair has the form: property: value are separated by semicolons, just as in the value of a <style> tag General Form, External sheets
Document-level style sheets appear in the head of the document External style sheets are in separate files, potentially on any server on the Internet Written as text files with the MIME type text/css Linking an External Stylesheet A <link> tag is used to specify that the browser is to fetch and use an external style sheet file <link rel = "stylesheet" type = "text/css" href = ""> </link> - External style sheets can be validated validator-upload.html Style Specification Formats Format depends on the level of the style sheet Inline: Style sheet appears as the value of the style attribute General form: style = "property_1: value_1; property_2: value_2; … property_n: value_n" Format for Document-level Style sheet appears as a list of rules that are the content of a <style> tag The <style> tag must include the type attribute, set to "text/css" The list of rules must be placed in an HTML comment, because it is not HTML Comments in the rule list must have a different form - use C comments (/*…*/) General Form, Document General form: type = "text/css"> <!-- rule list --> </style> Form of the selector {list of property/values} Each property/value pair has the form: property: value are separated by semicolons, just as in the value of a <style> tag General Form, External sheets