• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Hour 18. Working with Style Sheets > Workshop: Creating Dynamic Styles

Workshop: Creating Dynamic Styles

Using the DOM style objects, you can create a page that allows you to directly control the colors used in the page's text. To begin with, you will need a form with which to select colors. The following is a basic form using <select> tags to define options for head and body colors:

<FORM NAME="form1">
<B>Heading color: </B>
<select name="heading" onChange="changehead();">
   <option value="black">Black</option>
   <option value="red">Red</option>
   <option value="blue">Blue</option>
   <option value="green">Green</option>
   <option value="yellow">Yellow</option>
</select>
<br>
<B>Body text color: </B>
<select name="body" onChange="changebody();">
   <option value="black">Black</option>
   <option value="red">Red</option>
   <option value="blue">Blue</option>
   <option value="green">Green</option>
   <option value="yellow">Yellow</option>
</select>
</FORM>


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint