HTML Questions and Answers - Fundamentals-4

1. Which element is used for creating links?
a) <a>
b) <p>
c) <li>
d) <ol>

Answer: a
Explanation: <a> element is used for creating links. We can click anything written between opening <a> tag and closing </a> tag. E.g., <a href= “”> GMAIL </a>. The text written between <a> and </a> is called link text. <p></p> defines paragraph. <li> specifies list of item. <ol> is ordered list which can be either numerically or alphabetically.

2. For defining bookmarks in a page we use __________
a) href
b) id
c) target
d) <a>

Answer: b
Explanation: id attribute is used for defining bookmarks in a page. For linking to the bookmark we use href attribute. Target attribute is used to define where to open a linked document. <a> element is used to define a link.

3. Which of the following is the correct way to create a list using the lowercase letters?
a) <ol alpha = "a" >
b) <ol type = "a">
c) <ol letter = "a">
d) None of the above

Answer: b
Explanation: The type attribute is used with the <ol> tag to specify the type of list items.

4. An HTML program is saved by using the ____ extension.
a) .ht
b) .html
c) .hml
d) None of the above

Answer: b
Explanation: The .html or .htm extension both are used to save the HTML program. We can save our HTML file either by using the .html extension or by .htm extension. When the file delivered to the network, the HTML extension indicates that the content of file is HTML.

5. Which one of the following colors will be darkest?
a) rgba(255,99,71,0)
b) rgba(255,99,71,0.5)
c) rgba(255,99,71,0.8)
d) rgba(255,99,71,0.2)

Answer: c
Explanation: The higher the value of a parameter in rgba, the less transparent the color will be. Hence rgba(255,99,71,0.8) will be the darkest among the four.

6. #ffffff is equivqlent to which color in rgb color representation?
a) rgb(0,0,0)
b) rgb(100,100,100)
c) rgb(90,90,90)
d) rgb(255,255,255)

Answer: d
Explanation: Both #ffffff and rgb(255,255,255) represents white color.

7. Which of the following color codes of HTML represent the same color?
(i) #00ff00
(ii) hsl(120,100%,50%)
(iii) rgb(255,99,71)

a) All three
b) i and ii
c) i and iii
d) ii and ii

Answer: b
Explanation: i and ii represents color green while iii represents color tomato.

8. Which of the following is not true regarding to counter?
a) counter(name,style)
b) counter(name)
c) counter(string)
d) counter(name,string,style)

Answer: c
Explanation: There are two functions for specifying counters, ‘counter()’ or ‘counter()’. First one has two forms ‘counter(name,style)’ and ‘counter(name)’. The second one also has two forms ‘counter(name,string,style)’ and ‘counter(name,string)’.

9. What is the total number of colors that can be represented using HEX system in HTML?
a) 16^3
b) 16^6
c) 2^6
d) 2^16

Answer: b
Explanation: Each digit of #rrggbb can have 16 values (from 0 to F) and there are total of 6 digits. Hence, the total number of possible colors = 166.

10. Each of RGB has its value from-
a) 0 to 256
b) 0 to 254
c) 0 to 255
d) 1 to 256

Answer: c
Explanation: Each color of RGB has its value ranging from 0 to 255. The more the value, the darker is its intensity.