-
Book Overview & Buying
-
Table Of Contents
Practical Web Development
By :
Practical Web Development
By:
Overview of this book
Adding styles to our documents
So how do the CSS rules become part of our document? There are three ways:
External style sheets
Internal CSS
Inline styles
External style sheets
This is the recommended way to add CSS to your site. It should be your goal for all style sheets of the production version of your site to be external. Simply add a line to the <head> section of your site, which should look like the following:
<link rel="stylesheet" type="text/css" href="css/style.css">
<link> is an HTML element we had not yet introduced. Its attributes are listed below:
rel, to indicate the relationship between the HTML document and the linked file.typespecifies the MIME type of the document so the browser knows how to load it.hrefis used to specify the location of the file. You may expect asrcattribute here, like is used for<img>tags, but the attribute to specify the file name in a<link>element ishref. For the file name, we recommend that you always use relative...
Change the font size
Change margin width
Change background colour