In HTML 4.0, all formatting can be removed from the HTML document, and stored in a style sheet.
Using styles in HTMLHow to add style information into the <head> section.
Link that is not underlinedHow to make a link that is not underlined, with the style attribute.
Link to an external style sheetHow to use the <link> tag to link to an external style sheet.
When a browser reads a style sheet, it will format the document according to it.
There are three ways of inserting a style sheet:
An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing one file. Each page must link to the style sheet using the <link> tag. The <link> tag goes inside the <head> section:
An internal style sheet can be used if one single document has a unique style. Internal styles are defined in the <head> section of an HTML page, by using the <style> tag, like this:
An inline style can be used if a unique style is to be applied to one single occurrence of an element.
To use inline styles, use the style attribute in the relevant tag. The style attribute can contain any CSS property. The example below shows how to change the text color and the left margin of a paragraph:
To learn more about style sheets, visit our CSS tutorial.
Your Query was successfully sent!