- Write a CSS rule that gives all h1 and h2 elements a padding of 0.5 ems, a dashed border style and a margin of 0.5 ems. [1 Marks]
Answer: - Write a CSS rule that changes the color of all elements containing attribute class = “greenMove” to green and shifts them down 25 pixels and right 15 pixels. [1 Marks]
Answer: - Make a layout template that contains a header and two paragraphs. Use float to line up the two paragraphs as columns side by side. Give the header and two paragraphs a border and/or a background color so you can see where they are. [1 Marks]
Answer:
Question 2: CLO 3 [5 Marks]
- Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track of several tankfuls of gasoline by recording the number of miles driven and the number of gallons used for each tankful. Develop a script that will take as input the miles driven and gallons used (both as integers) for each tankful. The script should calculate and output HTML5 text that displays the number of miles per gallon obtained for each tankful and prints the combined number of miles per gallon obtained for all tankfuls up to this point. Use prompt dialogs to obtain the data from the user. [2.5 Marks]
Answer:
- Write a script that uses looping to print the following table of values. Output the results in an HTML5 table. Use CSS to center the data in each column. [2.5 Marks]
Sample Solution