Advertisement
MrsMcLead

CSS Class and ID

Feb 10th, 2014
518
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.68 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>
  4. CSS got class.... CSS got style!
  5. </title>
  6. <style type = "text/css">
  7. body
  8. {
  9.     background-color:#AAAAAA;
  10. }
  11. h1
  12. {
  13.     color:#C78745;
  14. }
  15. p
  16. {
  17.     color: purple;
  18.     font-family: Impact;
  19. }
  20. table, td
  21. {
  22.     border: 5px solid black;
  23. }
  24.  
  25. /*This is a comment to let you know that the below is a class!*/
  26. .green
  27. {
  28.     color:green;
  29.     font-family: Impact;
  30. }
  31.  
  32. /*Ad ID is similar to a class, but it can only be used once */
  33. #redAlign
  34. {
  35.     text-align: center;
  36.     color:red;
  37. }
  38. </style>
  39. </head>
  40.  
  41. <body>
  42. <ul>
  43.     <li>potatoes</li>
  44.     <li class = "green">french fries</li>
  45.     <li> chips </li>
  46.     <li> mashed potatoes </li>
  47.     <li id = "redAlign"> hash browns </li>
  48. </ul>
  49. </body>
  50. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement