How to Use CSS

CSS stands for Cascading Style Sheets and it is a form of computer coding language that refers to the layout of text and images on a Web age. CSS is not the most designer-friendly system, but still it is a very simple and useful way to write code for your own website. This code is always being upgraded and improved and as a result, when used alongside basic HTML language and Java script, it is possible to come up with some impressively designed Web pages.

Instructions

    • 1

      Learn to use CSS language inside your HTML tags. This is called creating styles and it is the first step in understanding CSS language. For instance, if you were trying to obtain a background color using solely HTML, your tag would probably read like this:<body bgcolor=”#000000”>This would give you a black background. However, if you like, you can place the HTML tag with a CSS attribute for the same item, background color. It would look like this:<body style=”background: #000000;”> This would have the same effect as the HTML language listed above, but it has the advantage of using the newer and improved CSS language, for in CSS, the background attribute can control a lot more than just color.

    • 2

      Create an internal style sheet. Each page can be controlled by CSS language. To do this you place the CSS tags in the head of each page and then each tag will effect the whole page, but only that page. To place the background color attribute using CSS in an internal style sheet your code might read like this.<html><head><style type=”text/css”>body {background:#000000,color:ffffff,}</head><body></body></html>This information not only gives you a black background as in the previous examples, but you also get a white color that will be applied to all text. Notice how the CSS attribute is now located inside the curlicue brackets.

    • 3

      Use an external style sheet, which can control many pages within the same website. This is one of the great advantages of CSS. You can create a template for a basic page in a separate place. This web page will end in the suffix ".css" and all pages that are linked to it will share whatever attributes the page directs. To link to a given CSS page your HTML language would look like this:<html><head><link rel=”stylesheet” type=”text/css” href=”myfirststylesheet.css” />/head><body></body></html>This notation would import any attributes listed on the separate style sheet. What is really great about this method is that you can link many pages to this one stylesheet called ”myfirststylesheet.css.” All pages would share the properties listed, but these properties could be changed in each individual page if necessary.

    • 4

      Study the code on other websites that you like. To find the page code in Internet Explorer, just click on the page icon and on the "View Source" heading. Other people's code should only be used as a guideline and it should never be copied directly.

Tips & Warnings

  • A good place to visit to learn more and also to see what is possible is csszengarden.com (see Resources below).

  • Studying the code of websites that you like is a wonderful way to learn about constructing Web pages, but copying the code verbatim is plagiarism and is an infringement of copyrights.

Related Searches:

Resources

Comments

You May Also Like

Related Ads

Featured