Chapter-3 Web Designing with HTML5 & CSS — Online MCQ Test
INFORMATION TECHNOLOGY · Grade 7 · CBSE(NCERT)
Practice Chapter-3 Web Designing with HTML5 & CSS with a free chapter-wise online MCQ test.
This chapter covers: HTML tags - image tag - anchor tag - table tag - attributes - hyperlinks - inline CSS - external CSS - text styling.
AI-generated questions from basic to board-exam level, with instant results and explanations.
Chapter-3 Web Designing with HTML5 & CSS — Important Questions & Answers
Which HTML tag is used to insert an image in a web page?
- A. <img>
- B. <image>
- C. <picture>
- D. <photo>
Answer: A. <img>
The <img> tag is the standard HTML5 tag used to embed images in web pages.
The <img> tag is the standard HTML5 tag used to embed images in web pages.
What is the correct syntax for the 'src' attribute in an image tag?
- A. <img src='image.jpg'>
- B. <img source='image.jpg'>
- C. <img href='image.jpg'>
- D. <img link='image.jpg'>
Answer: A. <img src='image.jpg'>
The 'src' attribute specifies the source path of the image file. 'source', 'href', and 'link' are not valid image tag attributes.
The 'src' attribute specifies the source path of the image file. 'source', 'href', and 'link' are not valid image tag attributes.
What is the 'alt' attribute in an image tag used for?
- A. To align the image on the page
- B. To provide alternative text if the image cannot be loaded
- C. To change the image color
- D. To create a link from the image
Answer: B. To provide alternative text if the image cannot be loaded
The 'alt' attribute provides alternate text that is displayed when an image fails to load or for accessibility purposes.
The 'alt' attribute provides alternate text that is displayed when an image fails to load or for accessibility purposes.
A student creates a table with 3 rows and 4 columns. How many <td> tags will be needed in total (excluding <th> tags)?
- A. 7
- B. 12
- C. 3
- D. 4
Answer: B. 12
Each cell in a table requires one <td> tag. With 3 rows and 4 columns, the total is 3 × 4 = 12 <td> tags.
Each cell in a table requires one <td> tag. With 3 rows and 4 columns, the total is 3 × 4 = 12 <td> tags.
Consider a scenario where CSS is applied both inline and externally to the same element. Which CSS will take precedence?
- A. External CSS will always override inline CSS
- B. Inline CSS will override external CSS due to higher specificity
- C. The first CSS encountered will take precedence
- D. Both will be applied equally; browser will choose randomly
Answer: B. Inline CSS will override external CSS due to higher specificity
Inline CSS has higher specificity than external or internal CSS, so inline styles override conflicting external styles in the CSS cascade.
Inline CSS has higher specificity than external or internal CSS, so inline styles override conflicting external styles in the CSS cascade.