| | |
multi color background question
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Jan 2009
Posts: 17
Reputation:
Solved Threads: 0
I am trying to write code that will list different automobiles in three different ordered lists with three different colored backgrounds ( using document style CSS). The lists are compact, midsize, and sport. I have my ordered list working correctly--except I can't get my colors to work. Can someone tell me what I am doing wrong
HTML and CSS Syntax (Toggle Plain Text)
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>multi-colored background</title> <style type = "text/css"> ol {list-style-type: upper-roman;} ol ol {list-style-type: upper-alpha;} ol ol ol {list-style-type: decimal:} p.compact{background-color: pink;} p.midsize {background-color:blue;} p.sport {background-color: red;} </style> </head> <h2>Automobile Types </h2> <ol> <p.class = "compact"> <li><h3>Compact</h3> <ol> <li><h4>Two Door</h4> <ol> <li>Dodge Neon</li> <li>Chevy Cobalt</li> <li>Ford Focus</li> </ol> </li> <li><h4>Four Door</h4> <ol> <li>Dodge Neon</li> <li>Chevy Cobalt</li> <li>Ford Focus</li> </ol> </li> </ol> < /li><br /> </p> <p class = "midsize"> <li><h3>Mid Size</h3> <ol> <li><h4>Two Door</h4> <ol> <li>Chrysler Serbring</li> <li>Dodge Caliber</li> <li>Dodge Charger</li> </ol> </li> <li><h4>Four Door</h4> <ol> <li>Dodge Stratus</li> <li>Dodge Intrepid</li> <li>Chrysler Concord</li></p> </ol> </li> </ol> </li><br /> </p> <p class = "sport"> <li><h3>Sports</h3> <ol> <li><h4>Coupe</h4> <ol> <li>Dodge Viper</li> <li>Dodge Charger</li> <li>Chevy Camero</li> </ol> </li> <li><h4>Convertible</h4> <ol> <li>Dodge Viper</li> <li>Ford Mustang</li> <li>Chevy Corvette</li></p> </ol> </li> </ol> </li> </p> </body> </html>
Last edited by tmoney7566; Oct 4th, 2009 at 12:18 am.
•
•
Join Date: Dec 2008
Posts: 63
Reputation:
Solved Threads: 13
A <p> element cannot contain another block-level element. A <p> is implicitly ended when another block-level element is encountered. Add the colours to the <ol>s directly.
Last edited by cfajohnson; Oct 4th, 2009 at 1:31 am.
Chris F.A. Johnson
http://cfajohnson.com
http://cfajohnson.com
![]() |
Similar Threads
- different color background for text with respect to time (HTML and CSS)
- PC freeze up with multi-color strip screen (Troubleshooting Dead Machines)
- Background color question (HTML and CSS)
- How to restore transparent desktop icon (Windows NT / 2000 / XP)
- Background question (JavaScript / DHTML / AJAX)
Other Threads in the HTML and CSS Forum
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7





