|
4 ways of defining styleThe browser needs to know what style sheet or style elements being specified. There are several ways style can be specified: 1. embedding a style <STYLE TYPE="text/css"> <!-- ...style code goes here... --> </STYLE> If you are familiar with JavaScript you will notice the same use of comments to fool older browser to ignore the extra code. The HTML specification states that browsers are to ignore tags they do not understand. Thus, an older browser reading this could would ignore the STYLE tag, and then bypass the style code because it is between HTML comments (<!-- -->) 2. Linking to a separate style sheet file <LINK REL=STYLESHEET TYPE="text/css" HREF="style.css"> style.css would simply be a text file containing your style definitions (minus the surrounding <style> tags). 3. Importing a style sheet <STYLE TYPE="text/css"> <!-- @import url(style.css); ... rest of style code goes here --> </STYLE> 4. Inline style <P STYLE="margin: 1.0in">This paragraph will have 1" margins all around.</P>
|