multi color background question

Thread Solved

Join Date: Jan 2009
Posts: 17
Reputation: tmoney7566 is an unknown quantity at this point 
Solved Threads: 0
tmoney7566 tmoney7566 is offline Offline
Newbie Poster

multi color background question

 
-1
  #1
Oct 4th, 2009
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)
  1. <html xmlns="http://www.w3.org/1999/xhtml">
  2. <head>
  3. <title>multi-colored background</title>
  4. <style type = "text/css">
  5.  
  6.  
  7. ol {list-style-type: upper-roman;}
  8. ol ol {list-style-type: upper-alpha;}
  9. ol ol ol {list-style-type: decimal:}
  10.  
  11.  
  12. p.compact{background-color: pink;}
  13. p.midsize {background-color:blue;}
  14. p.sport {background-color: red;}
  15.  
  16.  
  17.  
  18.  
  19. </style>
  20. </head>
  21.  
  22.  
  23. <h2>Automobile Types </h2>
  24. <ol>
  25.  
  26. <p.class = "compact">
  27. <li><h3>Compact</h3>
  28. <ol>
  29. <li><h4>Two Door</h4>
  30. <ol>
  31. <li>Dodge Neon</li>
  32. <li>Chevy Cobalt</li>
  33. <li>Ford Focus</li>
  34. </ol>
  35. </li>
  36. <li><h4>Four Door</h4>
  37. <ol>
  38. <li>Dodge Neon</li>
  39. <li>Chevy Cobalt</li>
  40. <li>Ford Focus</li>
  41. </ol>
  42. </li>
  43. </ol>
  44. < /li><br />
  45. </p>
  46.  
  47. <p class = "midsize">
  48. <li><h3>Mid Size</h3>
  49. <ol>
  50. <li><h4>Two Door</h4>
  51. <ol>
  52. <li>Chrysler Serbring</li>
  53. <li>Dodge Caliber</li>
  54. <li>Dodge Charger</li>
  55. </ol>
  56. </li>
  57. <li><h4>Four Door</h4>
  58. <ol>
  59. <li>Dodge Stratus</li>
  60. <li>Dodge Intrepid</li>
  61. <li>Chrysler Concord</li></p>
  62. </ol>
  63. </li>
  64. </ol>
  65. </li><br />
  66. </p>
  67.  
  68. <p class = "sport">
  69. <li><h3>Sports</h3>
  70. <ol>
  71. <li><h4>Coupe</h4>
  72. <ol>
  73. <li>Dodge Viper</li>
  74. <li>Dodge Charger</li>
  75. <li>Chevy Camero</li>
  76. </ol>
  77. </li>
  78. <li><h4>Convertible</h4>
  79. <ol>
  80. <li>Dodge Viper</li>
  81. <li>Ford Mustang</li>
  82. <li>Chevy Corvette</li></p>
  83. </ol>
  84. </li>
  85. </ol>
  86. </li>
  87. </p>
  88.  
  89.  
  90. </body>
  91. </html>
Last edited by tmoney7566; Oct 4th, 2009 at 12:18 am.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 63
Reputation: cfajohnson is an unknown quantity at this point 
Solved Threads: 13
cfajohnson cfajohnson is offline Offline
Junior Poster in Training

Re: multi color background question

 
0
  #2
Oct 4th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 17
Reputation: tmoney7566 is an unknown quantity at this point 
Solved Threads: 0
tmoney7566 tmoney7566 is offline Offline
Newbie Poster

Re: multi color background question

 
0
  #3
Oct 4th, 2009
I found it--I had to use the (div.) class to get it to work...
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 11
Reputation: josephajain is an unknown quantity at this point 
Solved Threads: 0
josephajain josephajain is offline Offline
Newbie Poster

Re: multi color background question

 
0
  #4
Oct 5th, 2009
Even i want to work on dis...
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC