 
   
   
   
   
   
   
   
   
   
   
CS174
Chris Pollett
Feb 15, 2017
<p style="color:red;">red paragraph</p>
<link rel="stylesheet" type="text/css" href="mystyles.css" />
<tag style="property_1: value1 ; property2: value2; ..." >
<style type="text/css" >
    /* here is a comment */
	rule_list
</style>
selector {property_1: value1 ; property2: value2; ...}
h1 {font-size: 24pt;} /* would apply to all h1 tags in the document */
h2, h3 {font-size: 14pt;} /* notice applies to both h2 and h3 tags */
You can also specify that styles should only apply to elements in certain positions within the file:
body b i {font-size: 30pt;} /* only for bolded italic'd text within file, doesn't work NS7*/
p.normal {prop_list1}
p.narrow {prop_list2}
<p class="normal">normal look text</p>
.red {color:red}
<h3 class="red"></h3> <p class="red"></p>
p#sec1 {prop_list2}
To use this we do:
<p id="sec1">section1 text</p>
input:hover {color:red} /* input tag will turn red when mouse over. */
input:focus {color:green} /* when click into 
   input field, it will turn green */
<style type="text/css">
div:first-child b
{
   color:blue
}
div:before
{
    content:"The following div tag has something to tell you: ";
} 
</style>
<div>
<b>I'm blue</b>
</div>
<div>
<b>But I'm not</b>
</div>
rgb(0, 0, 0) /*decimal */ #C8C8C8 /*hex */
<li style="list-style-image: url(mybullet.png)"> item </li>