Exercise 2 – Internal Style
Sheets
- Open Notepad and create a Web page called “InternalStyleSheet.htm” and save it in your HTML folder. In the <TITLE> tag add “Internal Style Sheets in HTML”. Be sure to include all the proper opening and closing HTML tags that a Web page requires.
- Inside the opening and closing <BODY> tags insert the following code:
<H1>Making
Class Selectors</H1>
<STYLE>
body {color:blue}
P.note
{margin-left:-.05in;width:250;border:solid 3px
black;position:relative;background-color:lightBlue;}
LI.note {border:inset 3px
gray;background-color:cyan;}
.tip { background-color:yellow;border:inset
2px yellow;
margin-bottom:.2in;}
.resource {
background-color:green;border:inset 2px green;
margin-bottom:.2in;color:white;}
.warning { background-color:red;border:inset
2px red;
margin-bottom:.2in;}
</STYLE>
<BODY>
<P class="note">This text
will appear as a light blue box
with black borders.</P>
<UL>
<LI class="note">This
will appear as a bulleted point with a
cyan, inset background.</LI>
</UL>
<DIV class="tip">This is a
specialized note called a tip.</DIV>
<DIV class="resource">A
resource note, like this, might point to some
external
resource.</DIV>
<DIV class="warning">A
warning note indicates an action that might prove
problematic (like
causing your system to crash).
</DIV>
Make sure you save your file
periodically as you put in your code to make sure all your code is saved. You will also need to make sure the file has
been saved before displaying it in a browser.
- Open the file in Internet Explorer. (Do not close Internet Explorer after you view the file.) The file should look like this:
- If the file does not display correctly, go back to your Notepad file and check that all code has been properly typed. Make any corrections you find. After making corrections, resave the file and go back and refresh your browser by either clicking on the “refresh” icon or going to View – Refresh in the menu bar. Keep repeating this process until your page displays properly in Internet explorer.

0 comments:
Post a Comment