Friday, August 24, 2012

Web Design - Lesson By Lesson


Today I thought to publish CSS rules,because when we consider about a Cascading Stylesheet rules,it tells what the HTML looks like to the browser.From that rule we can say how HTML tag should look like,as well you can create your own rule for this.
So,there are three parts to a rule.They are:
1.Selector
2.Property
3.Value

The Selector
In Selector also we can find three types.They are:

1.HTML Selector
2.Class Selector
3.ID Selector

HTML Selector
This is the text part of an HTML tag. The complete paragraph tag is <P>. So its Selector is just P.

Class Selector 
This is one you set up yourself, to be used anywhere on your page.

ID Selector
This is similar to a Class selector, but we use them to identify a particular element.

You can try out these three types of selectors by this example.

<STYLE>
H1{Color: Red}

.NewFont{Font-Size: 16pt}

#NewTextboxColour{Color:Yellow}
</STYLE>

Property and Value

After you set up a selector,you have to define the properties and values for that selector.
The Property for the selector is the thing you’re trying to change.
Examples are: Font, Color, Background, Margin, Text.

The Value for the selector is the new setting for the property.
For example, for our COLOR property, we can set it to a value of an actual colour (red, blue, yellow), or a colour code (#FFFF00, #000000).

The property and the value are enclosed in curly brackets { }. The syntax for the whole thing would then be:
Selector {Property: Value}
An example is:
        H1 {Color: Red}

So you can develop this like below:
H1 {Color: Red; Font-weight: Bold; Font-Size: 16pt;}





No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...