|
Related Articles + Build your own website from scratch Related Links |
Building a template file. STEP 6: CSS Styles PART II If you tried the code above right away, you would have surely seen that it doesn't look pretty, why? Because it lacks the formatting. So we need to add some extra code in the <style> section so that it looks better. Next some CSS styling is needed to fix some colors and to add some classes for proper formatting. <style type="text/css"> What happened above was that I fixed some colors in the layers, added some classes for formatting (title, subtitle, monospace, gray and tiny) and stated the default style for any paragraph (the <p> tag). STEP 6.1: CSS Style Sheets, the *.CSS files You can now save the CSS in a separate file and link it in the page, just copy the above code without the <style> tags into a new file and save it as styles.css (you can change styles for whatever name you see fit) and then erase the whole code shown above from your template file and write this instead: <link href="styles.css" rel="stylesheet" type="text/css"> The step above is optional and has no effect on the output; it only saves some space by linking to the file instead of having it on every page. It also makes the updates easier since you now have to edit just one *.css file instead of each page. |
Affiliates |