Style Attribute

lew

New Member
Style Attribute/ Visual Appearance

Hello,

Does the style attribute have any affect on the visual appearance
of the Web page?
 

AusQB

New Member
The style attribute is the most important common attribute as it determines how your site looks and acts.

In old standards of HTML, styles would normally be attributed by simply listing individual style elements:

Code:
<div width="300" bgcolor="black">


In XHTML, the standard is to use the style attribute:

Code:
<div style="width: 300px; background-color: #000000;">


So basically, the style attribute encapsulates all the "customization data" for a particular element.
 

conor

New Member
Well it depends on how you use it. If you do this it will have no effect:

Code:
<div style="">

If you do this it will change the text color in the div:

Code:
<div style="color:#ccc;">
 

mezangath

New Member
Try using CSS documents instead, much easier to edit if you want to change something.

The style attribute in the tag is just to use CSS code in the tag.

Try going for:

Code:
<div class="div1></div>

And in your CSS document:

Code:
.div1 {
width: 300px; 
background-color: #000000;
}

Then you'll have 1 place to edit the div properties if you decide to have many of div's with the same CSS property.
 
Top