HTML Attributes
So let's study html attribute. As I have said before, html attributes creates behavior for html tags. Every tags could have their own attributes, but some tags could use same attributes. For example, the table tag <table> and the column tag <td> both have the "width" attribute:
| <table width="500px;"> or <table width="90%"> |
| <td width="500px"> or <td width="50%"> |
But of course you should only use logical attributes for every tag, otherwise it will only be ignored by the browser. For example, it is so wrong to write a "valign" attribute to a column tag since it only uses the "align" tag. Column tag can only align your content on horizontal basis which are: left, right, center.
"align" attribute is used to a column tag <td> while "valign" is used on the row tag <tr>
This could comprehend more if you could see some examples:
|
<table border="1" width="50%" height="100px"> <tr valign="middle"> <td align="center"> This is a centered text </td> </tr> <tr> <td> This area will have the default settings </td> </tr> </table> |
The code above will have the following output:
| This is a centered text |
| This area will have the default settings |
So that will be for html attributes for now, i believe that you got the idea about attributes. Lets proceed to the other lessons:


0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
Links to this post:
Create a Link
<< Home