0% found this document useful (0 votes)
12 views

G2

The document contains a series of questions and answers related to HTML, CSS, and web development concepts. Each question tests knowledge on specific attributes, elements, and properties, with correct answers provided for each. The questions cover topics such as responsive images, form validation, CSS box model, and navigation elements.

Uploaded by

ranshuman706
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

G2

The document contains a series of questions and answers related to HTML, CSS, and web development concepts. Each question tests knowledge on specific attributes, elements, and properties, with correct answers provided for each. The questions cover topics such as responsive images, form validation, CSS box model, and navigation elements.

Uploaded by

ranshuman706
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

1.

Which of the following attributes is mandatory for the <img> tag when using the
<picture> element for responsive images?
A) alt
B) src
C) type
D) srcset
MARKS: 1.5
ANSWER: A

2. In a <picture> tag, which element is used to provide fallback content for


browsers that do not support the picture element?
A) <source>
B) <img>
C) <fallback>
D) <media>
MARKS: 1.5
ANSWER: B

3. In CSS, which of the following units is relative to the font size of the root
element?
A) em
B) px
C) rem
D) pt
MARKS: 1.5
ANSWER: C

4. Which of the following form input types automatically validates the input to
ensure it is a valid email address?
A) <input type="email">
B) <input type="text">
C) <input type="url">
D) <input type="tel">
MARKS: 1.5
ANSWER: A

5. How do you specify that a form element is mandatory before submission in HTML5?
A) validate
B) required
C) must
D) mandatory
MARKS: 1
ANSWER: B

6. What is the correct order of the CSS box model (from inside out)?
A) Content, Padding, Border, Margin
B) Margin, Border, Padding, Content
C) Padding, Content, Margin, Border
D) Content, Border, Padding, Margin
MARKS: 1.5
ANSWER: A

7. What will the CSS rule display: inline-block; do to an element?


A) Place it inline but allow block-level styling
B) Place it on a new line and give it block-level styling
C) Make it behave as a block but with inline behavior
D) Make it invisible but take up space
MARKS: 1.5
ANSWER: A
8. Which HTML attribute can be used with a form to control the URL where the form
data is sent?
A) action
B) method
C) href
D) target
MARKS: 1.5
ANSWER: A

9. What happens if you do not set the method attribute in the <form> tag?
A) The form defaults to the GET method
B) The form defaults to the POST method
C) The form will not submit
D) The browser will throw an error
MARKS: 1.5
ANSWER: A

10. How can you specify a comment in a CSS file?


A) <!-- This is a comment -->
B) // This is a comment
C) /* This is a comment */
D) # This is a comment
MARKS: 1.5
ANSWER: C

11. Which of the following pseudo-classes is used to target elements that display
some change when put the cursor over them?
A) :hover
B) :focus
C) :visited
D) :active
MARKS: 1.5
ANSWER: A

12. How do you make an element take up the full width of its parent element?
A) width: 100%;
B) display: block;
C) display: inline-block;
D) position: absolute;
MARKS: 1.5
ANSWER: A

13. What does the box-sizing: border-box; CSS property do?


A) It makes the width and height include padding and borders
B) It sets the box model to content-box mode
C) It disables the box model
D) It adds extra space for margins to the box
MARKS: 1.5
ANSWER: A

14. In HTML, which element is used to define a navigation link or section that is
considered the primary navigation of the page?
A) <nav>
B) <aside>
C) <section>
D) <menu>
MARKS: 1.5
ANSWER: A
15. Which of the following is a valid example of creating an internal CSS style
rule?
A) <link rel="stylesheet" href="style.css">
B) <style> <h1 { color: blue; }>
C) <div style="color: blue;">Content</div>
D) <style> #tester {font-size: 3xl;} </style>
MARKS: 1.5
ANSWER: D

16. Which of the following correctly sets a default option in a <select> element,
even if no option is selected by the user?
A) Add the default attribute to the <select> tag
B) Add the selected attribute to the default <option> tag
C) Add the value="default" to the <select> tag
D) Add disabled to all other options except the default
MARKS: 1.5
ANSWER: B

17. Which unit is relative to the font size of the element in CSS?
A) px
B) em
C) pt
D) in
MARKS: 1.5
ANSWER: B

18. In HTML5, which element is used to display multiple <source> elements for
different media types, such as images?
A) <picture>
B) <source>
C) <video>
D) <object>
MARKS: 1.5
ANSWER: A

19. Which of the following is a correct example of using the media attribute in a
<source> tag to load an image for devices with a screen width of 1000px or more?
A) <source srcset="large.jpg" media="(min-width: 1000px)">
B) <source src="large.jpg" media="(min-width: 1000px)">
C) <source media="screen and (max-width: 1000px)" srcset="large.jpg">
D) <source src="large.jpg" sizes="1000px">
MARKS: 1.5
ANSWER: A

20. Which input type allows the user to enter both date and time values in an HTML
form?
A) <input type="time">
B) <input type="datetime-local">
C) <input type="date">
D) <input type="week">
MARKS: 1.5
ANSWER: B

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy