Sunday 17 November 2013

Html Class 4: Learn The Basic Html Attributes In This Class

Attributes tags

Telling Tags What To Do

We can change the way tags display things on web pages by putting what’s called an"attribute"into an opening tag. Many of the things that were done with attibutes are now done with CSS, so this lesson will show you how to put CSS code into tags by the use of the style attribute:

The style attribute’s job is to hold CSS code, that’s the stuff in the quotation marks. In the above example it's telling the h1 tag to center the text on the web page. Notice that there is a colon between text-align and center and at the end of center there is a semi colon. This is how CSS commands are structured. The text in our example can further be changed by adding another CSS command to the style attribute:

The result would be red text centered on the web page. An unlimited amount of CSS commands can be added to the style attribute as long as they are enclosed between the quotation marks and each command ends with a semi colon. The style attribute can be put in any opening tag to change some aspect of the tag, for instance when used with the body tag, all the text on a web page can be displayed in a different font:

The font-family command changes the text font, in this example it’s in Arialstyle.Adding a CSS background command in the body tag changes the page's background color:

That would give your web page a red background (you don’t really want a red web page do you?). Colors can be specified by either using the name of the color or its color code, for example #ff0000 is the color code for red:

The result would look like this: I’m biggerthan you Size of text is determined by the number, the larger the number the bigger the text,px stands for "pixels". As we move along in the tutorial you will be introduced to other attributes such as the src attribute which helps a tag put a picture on the web page. So let's head on over to lesson 5..

0 comments:

Post a Comment

 

Copyright @ 2013 The Best World's Blog About All Kind Of Information.