HTML CSS CSS Quiz

HTML CSS examples for CSS:Quiz

Description

Click the following links for the tutorial for CSS and Quiz.

  1. Center align the <div> element using margins.
  2. Position the <div> element all the way to the right using absolute positioning.
  3. Set the background-color to "pink" for elements with a "target" attribute.
  4. Set the background-color to "pink" for elements with an attribute like: target="_blank"
  5. Set a border with the color "red", around elements with a "title" attribute containing the word "red".
  6. Set a border with the color "red", around elements with a "title" attribute starting with "red".
  7. Set a border with the color "red", around elements with a "title" attribute ending with the word "flower" (not flowers).
  8. Set a border with the color "red", around elements with a "title" attribute containing the value "flow".


  9. Set the background color for the page to "linen" and the background color for <h1> to "pink".
  10. Set the background image of the page.
  11. Set the background image of the page, and repeat it vertically only.
  12. Set the background image to show once, in the top right corner.
  13. Use the shorthand background property to set background image, show it once, in the top right corner.
  14. Set a "4px", "dotted" border for <p>.
  15. Set the border color for <p> to "red".
  16. Change the 3 border properties, so that they only show the border on the top side.


  17. Set the border for p to "10px", "solid" and "green".
  18. Set the width of the div to "200px".
  19. Set the padding of the div to "25px".
  20. Set the border of the div to "25px solid navy".
  21. Set the margin of the div to "25px".
  22. Change the color of all <p> elements, that are descendants of <div> elements, to "red".
  23. Change the color of all <p> elements, that are immediate children of <div> elements, to "red".
  24. Change the color of <p> elements, that are immediately following sibling of a <div> element, to "red".
  25. Change the color of <p> elements, that are the siblings of a <div> element, to "red".
  26. Move the <div> element 100px to the right, and 200px down.
  27. Rotate the <div> element 45 degrees.
  28. Change the size of the <div> to half its width, but double its height.
  29. Skew the <div> element 20 degrees along the X-axis, and 30 degrees along the Y-axis.
  30. Rotate the <div> element 150deg around its X-axis.
  31. Rotate the <div> element 120deg around its Y-axis.
  32. Rotate the <div> element 90deg around its Z-axis.
  33. Add a 2 second animation for the <div> element, which changes the color from red to blue.
  34. Add 5 steps to the animation
  35. Set animation to have a "1" second delay before starting.
  36. Set the animation to loop for ever.
  37. Set animation to alternate between running forwards and backwards.
  38. Set animation to have a "ease-in-out" speed curve.
  39. Add a second background image to the <body> element.
  40. Change the size of the background image to: width 100px, height 80px.
  41. Change the size of the background image to fit the entire page.
  42. Set the background image position to start from the upper left corner of the content-box.
  43. Set the "painting area" of the background to the outside edge of the padding.
  44. Give the <div> element an image border. Slice the image at 30px and repeat it.
  45. Give the <div> element an image border. Slice the image at 30px and stretch it.
  46. Give the <div> element rounded corners
  47. Give the <div> element a rounded corner (25px radius) on the bottom left side.
  48. Set the opacity for the background color of the <h1> element to "0.3" by using a RGBA color instead of RGB.
  49. Set the HSL color as the background of the <h1> element
  50. Set the opacity for the background color of the <h1> element to "0.3" by using a HSLA color instead of HSL.
  51. Set the transparency/opacity of the <h1> element to "0.4".
  52. Add a web font with the name "sansation" and the URL
  53. Add another @font-face rule for bold characters of the "sansation" font.
  54. Set a linear gradient background for the <div> element, going from the top to bottom, transitioning from "white" to "green".
  55. Set a linear gradient background for the <div> element, going from the top left to the bottom right, transitioning from "white" to "green".
  56. Set a linear gradient background for the <div> element, going at a 70 degree angle, transitioning from "white" to "green".
  57. Set a linear gradient background for the <div> element, going from the top to bottom, transitioning from "white" to "red" to "blue" to "green".
  58. Set a linear gradient background for the <div> element, going from the top to bottom, transitioning from "rgba(0,255,0,0.2)" to "rgba(0,255,0,1)".
  59. Set a radial gradient background for the <div> element, transitioning from "white" to "green".
  60. Set a radial gradient background for the <div> element, with a circle shape, transitioning from "white" to "green".
  61. Set a "2px" horizontal, and "2px" vertical, text shadow for the <h1> element.
  62. Change the color of the text shadow to "green", and set a "5px" blur radius.
  63. Add a new shadow to the <h1> element with: no horizontal or vertical shadow, 10px blur, and a red color.
  64. Set a "10px" horizontal, and "10px" vertical, box shadow for the <div> element.
  65. Change the color of the box shadow to "grey", and set a "5px" blur.
  66. Set the overflowed content for the <p> element to have ellipsis (...)
  67. Set that text in the <p> element to wrap, even if it needs to split in the middle of a word.
  68. Set text in the <p> element to break between any two letters.
  69. Add a 2 second transition effect for width changes of the <div> element.
  70. Set that the transition of the <div> element should have a "ease-in-out" speed curve.
  71. Set the transition of the <div> element to have a "0.5" second delay before starting.
  72. Add a 2 second transition effect for background, and transform changes of the <div> element.
  73. Set transition of width for the <div> element to have: "2" second duration, "ease-in-out" speed curve, and a "0.5" second delay before starting.
  74. Set the height of <h1> to "100px".
  75. Set the width of <h1> to "50%".
  76. Hide the <h1> element and take up the same space as before.
  77. Hide the <h1> element. and not take up any space.
  78. Display the list items as inline elements.
  79. Display the <strong> elements as block elements.
  80. Set the font family for the page to "Courier New", and the font family for <h1> to "Verdana".
  81. Show <p> elements as "italic" text.
  82. Set the font size for the page to "20px", and the font size for <h1> to "3em".
  83. Show <p> elements as "bold" text.
  84. Using font property: Set the <p> to "italic", "20px" and "Verdana".
  85. Add an external style sheet with the URL: "mystyle.css".
  86. Set "background-color: linen" for the page, using an internal style sheet.
  87. Set "background-color: linen" for the page, using an inline style.
  88. Set the transparency/opacity of the <img> element to "0.4".
  89. Remove the transparency/opacity of the <img> element when the user hovers over it with the mouse pointer.
  90. Set the color for links to "green".
  91. Set the color for unvisited links to "red", and the color for visited links "blue".
  92. Remove underlines for visited and unvisited links, and specify "underline" for the hover and active link states.
  93. Set the list style for unordered lists to "square", and the list style for ordered lists to "upper-roman".
  94. Set the image as the list item marker for the unordered list.
  95. Set the unordered list marker to an image with a backup style of "circle", and display the markers inside the content flow.
  96. Remove the bullets/markers from the list items.
  97. Set the left margin of <h1> to "20px".
  98. Set all margins for <h1> to "25px".
  99. Set the top and bottom margins for <h1> to "50px", and left and right margins to "25px".
  100. Use the margin property to center align the <h1> element.
  101. Set a "solid", "5px" outline for <p>.
  102. Set the outline color for <p> to "green".
  103. Set the outline for p to "red", "dotted" and "10px".
  104. Add a scrollbar to the <div> element.
  105. Set the overflowing text in the <div> element to be invisible when overflow.
  106. Add a horizontal scrollbar to <div>.
  107. Set the top padding of <p> to "30px".
  108. Set all paddings for <p> to "50px".
  109. Set the top and bottom paddings for <p> to "25px", and left and right paddings to "50px".
  110. Position the <h1> element relative to the browser window. 50px from the top, and 50px from the right.
  111. Position the <h1> element 20px left, and 30px down, relative to its normal position.
  112. Position the <h1> element 50px from the left, and 100px from the top, relative to the HTML page.
  113. Position the <img> element behind the text.
  114. Position the element with the "topleft" class 30px from the left, and 15px from the top, relative to its container.
  115. Set the background color for visited and unvisited links to "pink", and the background color for the hover and active link states to "yellow".
  116. Change the background color, when a user hovers over p elements, with the class "highlight", to "pink".
  117. Set the background color of <p> elements, that are the first child of any element, to "pink".
  118. Set the background color of <input> elements that are in focus (clicked or active), to "pink".
  119. Set text color to red, for the first line of the <p> element.
  120. Set text color to "red", and the text size to "xx-large", for the first letter of the <p> element.
  121. Insert the image before, and after <p> elements, using the ::before and ::after pseudo-elements.
  122. Change the color of the element with id="para1", to "red".
  123. Change the color of all elements with the class "colortext", to "red".
  124. Change the color of all <p> and <h1> elements, to "red". Group the selectors to minimize code.
  125. Set the border to "2px solid green" for table, th and td elements.
  126. Collapse the table borders into a single border.
  127. Set the width of the table to "100%".
  128. Set the text alignment in <td> elements to "right".
  129. Set the padding in <th> elements to "15px".
  130. Set the background color of <th> elements to "pink".
  131. Set the text color for the page to "red", and the text color for <h1> to "blue".
  132. Center align the <h1> element.
  133. Remove the underline from the link.
  134. Style text in <h1> to uppercase letters, and text in <p> to capitalized letters.
  135. Indent the first line of the <p> element with 20px.
  136. Change the color of all <p> elements to "red".