Fundamentals of Front End Development MCQs with Answers
Practice important Fundamentals of Front End Development MCQs with answers and explanations.
Chapter: 27
Q321:
What is the purpose of CSS comments?
A. To add explanations to CSS code
B. To disable CSS rules
C. To make CSS more complex
D. To include external CSS files
Correct Answer:
A
Chapter: 27
Q322:
Fill in the blank: The declaration block in CSS contains one or more declarations separated by ______.
A. semicolons
B. colons
C. periods
D. commas
Correct Answer:
A
Chapter: 27
Q323:
What element is mandatory in an XHTML document?
A. <html> element
B. <p> element
C. <img> element
D. <table> element
Correct Answer:
A
Chapter: 27
Q324:
Fill in the blank: XHTML documents must have a _______ root element.
A. single
B. multiple
C. optional
D. complex
Correct Answer:
A
Chapter: 28
Q325:
What does XHTML stand for?
A. eXtensible HyperText Markup Language
B. eXtreme HyperText Markup Language
C. eXtra HyperText Markup Language
D. eXcellent HyperText Markup Language
Correct Answer:
A
Chapter: 28
Q326:
In XHTML, which of the following elements is mandatory?
A. <header>
B. <footer>
C. <html>
D. <section>
Correct Answer:
C
Chapter: 28
Q327:
What is a key difference between HTML and XHTML?
A. XHTML allows for optional <html> tags
B. XHTML allows for lowercase element names
C. XHTML does not support stylesheets
D. XHTML allows attribute minimization
Correct Answer:
B
Chapter: 28
Q328:
Fill in the blank: XHTML documents must have an _______ declaration.
A. XML
B. DOCTYPE
C. HTML
D. CSS
Correct Answer:
B
Chapter: 29
Q329:
Which of the following is true about CSS?
A. CSS defines how HTML elements are displayed
B. CSS can only be used inline
C. CSS cannot be used in external files
D. CSS does not support comments
Correct Answer:
A
Chapter: 29
Q330:
Which selector is used to select an element with a specific id?
A. .class
B. #id
C. element
D. [attribute]
Correct Answer:
B
Chapter: 29
Q331:
Fill in the blank: The CSS selector element > element selects elements where the parent is a ______.
A. child
B. sibling
C. descendant
D. ancestor
Correct Answer:
D
Chapter: 30
Q332:
Fill in the blank: URL encoding replaces non-ASCII characters with a "%" followed by _________.
A. decimal digits
B. binary digits
C. octal digits
D. hexadecimal digits
Correct Answer:
D
Chapter: 30
Q333:
What is the purpose of the <link> element in an HTML file?
A. To include inline CSS
B. To reference an external style sheet
C. To add internal styles
D. To define a CSS class
Correct Answer:
B
Chapter: 31
Q334:
Where should the <link> element be placed in an HTML file?
A. Inside the <body>
B. Inside the <footer>
C. Inside the <head>
D. After the closing </body> tag
Correct Answer:
C
Chapter: 31
Q335:
Which of the following is true about an internal style sheet?
A. It is defined within the <style> element
B. It is included in an external CSS file
C. It is used to style multiple pages
D. It is applied only to the <body> element
Correct Answer:
A
Chapter: 31
Q336:
Fill in the blank: Inline styles are applied directly within the _______ attribute.
A. style
B. class
C. id
D. href
Correct Answer:
A
Chapter: 31
Q337:
Which example shows an external style sheet being included in an HTML file?
A. <style>body {background-color: linen;}</style>
B. <h1 style="color:blue;">This is a heading.</h1>
C. <link rel="stylesheet" type="text/css" href="mystyle.css">
D. <head><style>body {background-color: linen;}</style></head>
Correct Answer:
C
Chapter: 31
Q338:
What is the purpose of using inline CSS in an HTML document?
A. To apply styles to multiple pages
B. To apply a unique style to a single element
C. To include a reference to an external style sheet
D. To define a global style
Correct Answer:
B
Chapter: 31
Q339:
Fill in the blank: An internal style sheet is placed inside the _______ element.
A. <footer>
B. <style>
C. <link>
D. <script>
Correct Answer:
B
Chapter: 31
Q340:
Which type of CSS would you use to style a single HTML page uniquely?
A. External style sheet
B. Inline CSS
C. Internal style sheet
D. Global CSS
Correct Answer:
C