HTML brief introduction (18)

How to Use Styles

When the browser reads a style sheet, it will follow this style sheet to format the document. There are three ways to insert a style sheet:

External style sheet

When the style needs to be applied to many pages when an external style sheet would be the ideal choice. Use an external style sheet, you can change a file to change the appearance of the entire site.

例如:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>

Internal style sheet
when a single file requires special style, internal style sheet can be used. You can <style> tag defines internal style sheet in the head portion.

For example: <head>

<style type="text/css">
body {background-color: red}
p {margin-left: 20px}
</style>

</head>

Guess you like

Origin blog.51cto.com/14583872/2444838