Example : Simple inline stylesheet
<HTML> <HEAD> <TITLE>Introduction to styles</TITLE> <STYLE> H1, H2, H3 { font-family: arial, trebuchet ms; text-decoration: underline; color: navy; } </STYLE> </HEAD> <BODY> <H1>this is the h1 tag, modified using css</H1> <H2>this is the h2 tag, modified using css</H2> <H3>this is the h3 tag, modified using css</H3> </BODY> </HTML>
So, what is the above code doing? - Well, we have redefined the H1, H2 and H3 tags in an "inline" stylesheet, i.e. one that is hardcoded within the page, rather than a separate CSS document. We have declared how we want H1, H2 and H3 to look, and then we have used the tags to display some text, using our styles.
In this instance, we have grouped H1, H2 and H3 together. HTML elements can be redefined individually, or, as shown, as a group.
In this instance, we have grouped H1, H2 and H3 together. HTML elements can be redefined individually, or, as shown, as a group.
No comments:
Post a Comment