Planning the Site and its Navigation
Planning the Site
Here are some techniques that many experienced Web developers use when planning a site.
Introduction to CSS
CSS stands for Cascading Style SheetsCSS defines how HTML elements are to be displayed. CSS is a language of its own, with syntax requirements and keywords
that are different than what we've seen in HTML and any other Web programming language.
There are three ways to apply CSS style rules in the Web pages.
Style Attribute
CSS is applied by creating style rules. These rules consist of two parts: the selector (HTML tag; the part of your document to
which you want to apply the formatting) and the declaration (the formatting you want applied). In the CSS rule here, text designated
as h1 in the HTML code will be formatted with the color red.
h1 {color: red;}
In this example, color is the property of the h1 tag, and red is the value of that property. The declaration is always enclosed in curly
braces unless it's the value for a style attribute, as in the example below. The CSS property is connected to its value by a colon.
To specify multiple properties and values in a single CSS declaration, each pair is separated by a semicolon following each value, as shown below.
h1 {color: red; font-size: 12px;}
To use this basic concept within the style attribute of an HTML tag, you would need to add the property and value to the style attribute of
the tag as follows.
<h1 style="color: red;">Heading Text</h1>
With external style sheets, the specifications and declarations are contained in a separate file. As such, they can be applied to all
of the pages in the website. External style sheet rules are sometimes referred to as being global in scope. External style sheets usually
have the file extension .css.
It is a good idea to add comments in the external style sheets to help you figure out what you did and why. If you haven't looked at the page
for a while, you might forget. Comments in a CSS file are formed with a slash asterisk (/*) to start the comment and the reverse (*/) to end the comment.
No comments:
Post a Comment