944,028 Members | Top Members by Rank

Ad:
Oct 4th, 2009
-1

multi color background question

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
tmoney7566 is offline Offline
17 posts
since Jan 2009
Oct 4th, 2009
0

Re: multi color background question

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.
Reputation Points: 25
Solved Threads: 23
Junior Poster
cfajohnson is offline Offline
193 posts
since Dec 2008
Oct 4th, 2009
0

Re: multi color background question

I found it--I had to use the (div.) class to get it to work...
Reputation Points: 10
Solved Threads: 0
Newbie Poster
tmoney7566 is offline Offline
17 posts
since Jan 2009
Oct 5th, 2009
0

Re: multi color background question

Even i want to work on dis...
Reputation Points: 10
Solved Threads: 0
Newbie Poster
josephajain is offline Offline
15 posts
since Oct 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC