.css
file. In fact, once you become adept at using style sheets, this will be —and should be— your go-to method of applying CSS..css
extension and saved to any directory that can be accessed by the web pages using it. Unlike embedded style sheets, the CSS rules sets do not have to be wrapped in the <style>...</style>
tags.
H1 {
font-family: 'Times New Roman';
font-size: 36px;
background: #ffffff;
color: maroon;
}
H2 {
font-family: arial,verdana,sans-serif;
font-size: 20px;
background: #ffffff;
color: black;
}
P {
font-family: arial,verdana,sans-serif;
font-size: 16px;
background: #ffffff;
color: navy;
}
main.css
and presto, you've got an external style sheet. link
element can be used, among other things, to specify that a web page should use an external style sheet. The link
element only requires a start tag <link>
and is inserted in between the <head>...</head>
tags of your web page (a.k.a., document head). It can be used as many times as you like.link
element employs three important attributes: rel
, type
and href
. For CSS, the value of the rel
attribute is always stylesheet
and the value of the type
attribute is always text/css
. The only part of the code you really have to concerned with is the value of the href
attribute which will change according to which .css
file you're referring to. This value can be any relative or absolute path.link
element inserted in the document head of a web page:<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="main.css">
</head>
<body>
...web page content...
</body>
</html>
link
element specifies that the web page should use an external style sheet called main.css
. link
element to refer to the same external style sheet, i.e., main.css
, then what you have essentially done is created a kind of central hub to apply formatting to many different web pages at once.
Free Text Editors
Free Graphics Editors
Website Analysis Tools
Free Website Templates
See also:
Best Free Web Hosting
How to Make a Web Page
If you need a .COM web address, you can get one quick and easy at...
<~ BACK | TOP | NEXT ~> |