Multiple choice questions and answers (MCQs) on HTML/CSS to prepare for exams, tests, and certifications. These questions are taken from a real written exam and some parts are taken from an interview. So you will find questions on basic techniques such as tags, web standards, CSS selector, objects, and more. This quiz will easily prepare anyone to pass their online test.
1. Which attribute can be used with the <table> tag to give your table a border?
A line
B border
C margin-left border
D All the answers are true
B
Example : <table border="1">
2. Which element has very similar properties to the DIV element?
A strong
B span
C table
D All the answers are true
B
The difference between span and div is that the span element is usually used for a small piece of code in a line, while the div element is a block and used to group together large pieces of code. Example:
<div id = "myDiv">
<p> Lorem <span class = "paper"> ipsum </span> </p>
</div>
3. What is the alternative to the <b> tag, to make the text bold?
A <bold>
B <strong>
C <i>
D <emp>
B
The correct alternative to the <b> tag for making text bold is the <strong> tag. While <b> simply makes text bold without adding any semantic meaning, <strong> not only makes the text bold but also signifies that the text has strong emphasis, which is helpful for accessibility and SEO. This makes <strong> a more meaningful and appropriate choice when you want to highlight important content in a paragraph.
4. What HTML stand for __________?
A HyperText Markup Language
B Hyper Teach Markup Language
C Hyper Tech Markup Language
D None of the above
A
HTML stands for HyperText Markup Language, which is the standard language used to create and design webpages. It uses a system of tags to structure content on the web, like headings, paragraphs, links, images, and more.
5. HTML web pages can be read and rendered by the _________.
A Compiler
B Server
C Web browser
D Interpreter
C
HTML web pages are designed to be read and rendered by a web browser (such as Chrome, Firefox, Safari, or Edge). The browser interprets the HTML code and displays the content in a readable format for the user.
Compilers and interpreters are used for programming languages (not specifically for HTML). Servers host the web pages but don’t render them for the user directly.
6. Which of the following is not an attribute of the <form> tag
A action
B method
C name
D url
D
If you want to specify the destination URL, you use the action attribute, not url.
7. HTML is a subset of ______ ?
A SGML
B SGMD
C SGMT
D None of the above
A
HTML (HyperText Markup Language) is a subset of SGML (Standard Generalized Markup Language). SGML is a standard for defining generalized markup languages for documents, and HTML is one of the markup languages derived from it, specifically designed for creating web pages.
8. Choose the correct HTML tag to render text in italics
A <italic>
B <it>
C <il>
D <i>
D
The <i> tag is used to render text in italics and can be used for visual styling.
9. Which tag is used to create a checkbox in HTML?
A<checkbox>
B<input type = "checkbox">
C<check>
D<input type = "checkbox">
B
10. How to create a link to an email?
A<a href="mailto:xxx@yyy">
B<a href="xxx@yyy">
CMail>xxx@yyy
DMail href="xxx@yyy"
A
To create a link that opens the user’s email client with a pre-filled email address, you use the mailto: scheme within the href attribute of an anchor tag <a>. This creates a clickable link that, when clicked, will open the default email application with the recipient’s email address pre-filled.
11. What is the latest version of CSS available?
A CSS2
B CSS3
C CSS3.1
D CSS4
B
The latest version of CSS is CSS3, which introduced new features like flexible layouts, animations, and media queries. CSS specifications are now updated through individual modules, rather than a single “CSS4.”
12. Which of the following properties defines the font size of the text?
A text-size
B font-size
C size
D text
B
Example : font-size: 12px;
13. Which of the following properties defines the spacing between letters?
A space
B line-height
C letter-spacing
D None of the above
C
The letter-spacing property in CSS defines the spacing between letters in a text. It allows you to adjust the amount of space between individual characters in a word or sentence. Example:
h1 {
letter-spacing: 9px;
}
Output:
Lorem Ipsum
MCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More
GOOD QUESTION