1/31
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Match the CSS property with its correct function:
color
font-size
border
margin
padding
A. Controls the space around an element (outside the border).
B. Controls the text color.
C. Controls the space inside an element (between content and border).
D. Defines the size of the text.
E. Defines the edges of an element.
B, D, E, A, C
Which of the following is a valid way to apply CSS to an HTML document?
a) Inline styles
b) Embedded styles
c) External styles
d) All of the above
d) All of the above
What does the #
symbol represent in CSS?
a) Class selector
b) ID selector
c) Universal selector
d) Element selector
b) ID selector
Which CSS property is used to control the spacing between lines of text?
a) letter-spacing
b) line-height
c) word-spacing
d) text-align
b) line-height
What is the default positioning of an HTML element?
a) Absolute
b) Fixed
c) Static
d) Relative
c) Static
Which CSS unit is relative to the font size of the root element?
a) px
b) em
c) %
d) rem
d) rem
1. Write a CSS rule that applies a blue background color to all <p>
elements.
p {
background-color: blue;
}
Write a CSS rule to create a red border (2px solid) around a div
with the ID "container".
#container {
border: 2px solid red;
}
Write a CSS rule that makes all links (<a>
elements) turn green when hovered over.
a:hover {
color: green;
}
Write a CSS rule that applies a font size of 18px and text color of gray to all elements with the class "text-style".
.text-style {
font-size: 18px; color: gray;
}
Match the HTML tag with its correct function:
HTML Tag | Function |
---|---|
1. | A. Creates a hyperlink. |
2. | B. Embeds an image. |
3. | C. Defines a paragraph. |
4. | D. Creates an unordered list. |
5. | E. Defines the largest heading. |
- C. Defines a paragraph.
- E. Defines the largest heading.
- A. Creates a hyperlink.
- B. Embeds an image.
- D. Creates an unordered list.
What is the correct DOCTYPE declaration for HTML5?
a) <!DOCTYPE html5>
b) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
c) <!DOCTYPE html>
d) <html lang="en">
c) <!DOCTYPE html>
Which HTML tag is used to define an unordered list?
a) <ol>
b) <ul>
c) <list>
d) <li>
b) <ul>
Which of the following is a self-closing tag in HTML?
a) <div>
b) <p>
c) <img>
d) <h1>
c) <img>
Which attribute is used to specify an alternative text for an image?
a) title
b) alt
c) src
d) href
b) alt
Which of the following elements is used for navigation in HTML5?
a) <header>
b) <nav>
c) <footer>
d) <aside>
b) <nav>
Write a basic HTML5 document structure.
<!DOCTYPE html>
<html lang="en">
<head>
<title>My First Page</title>
</head>
<body>
<h1>Welcome to My Website</h1>
<p>This is a sample webpage.</p>
</body>
</html>
Write an HTML code snippet to create a hyperlink to "https://example.com".
<a href="https://example.com">Visit Example</a>
Which CSS property is used to change the background color?
a) color
b) background-color
c) text-color
d) bgcolor
b) background-color
Match the HTML form element with its purpose:
HTML Tag | Purpose |
---|---|
1. | A. Allows multi-line text input. |
2. | B. Creates a dropdown list. |
3. | C. Accepts text input. |
4. | D. Creates a clickable button. |
5. | E.Allows one option selection. |
C. Accepts text input.
E. Allows one option selection.
B. Creates a dropdown list.
A. Allows multi-line text input.
D. Creates a clickable button.
Which form method should be used to securely send sensitive data?
a) GET
b) POST
c) SEND
d) DATA
b) POST
Which table element defines a table row?
a) <tr>
b) <td>
c) <th>
d) <table>
a) <tr>
Which attribute is used to group multiple checkboxes under the same name?
a) group
b) value
c) name
d) id
c) name
rite an HTML form with a text input, a password field, and a submit button.
<form action="submit.php" method="post">
<label for="username">Username:</label>
<input type="text" id="username" name="username">
<label for="password">Password:</label>
<input type="password" id="password" name="password">
<input type="submit" value="Login"> </form>
Write an HTML table with 3 rows and 2 columns.
html
<table border="1">
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>Row 1, Col 1</td>
<td>Row 1, Col 2</td>
</tr>
<tr>
<td>Row 2, Col 1</td>
<td>Row 2, Col 2</td>
</tr>
</table>
Matching Questions (Tables)
HTML Table Element | Function |
---|---|
1. | H. Groups the table footer rows. |
2. | B. Defines a table row. |
3. | G. Groups the table body rows. |
4. | I. Merges multiple columns into one cell. |
5. | C. Defines a standard data cell. |
6. | F. Groups the table header rows. |
7. | E. Provides a title for the table. |
8. | A. Defines a table. |
9. | J. Merges multiple rows into one cell. |
10. | D. Defines a table header cell. |
Matching Questions (Tables)
- G. Groups the table body rows.
- C. Defines a standard data cell.
- H. Groups the table footer rows.
rowspan - J. Merges multiple rows into one cell.
- B. Defines a table row.
- E. Provides a title for the table.
- A. Defines a table.
- F. Groups the table header rows.colspan
- I. Merges multiple columns into one cell.
- D. Defines a table header cell.
Which HTML tag is used to create a table?
a) <tbl>
b) <table>
c) <tab>
d) <t>
b) <table>
What does the colspan
attribute do in an HTML table?
a) Merges multiple rows into one cell
b) Merges multiple columns into one cell
c) Deletes a column
d) Changes the column width
b) Merges multiple columns into one cell
What is the correct HTML code to add a table header?
a) <td>
b) <tr>
c) <th>
d) <thead>
c) <th>
Which tag groups the body section of a table?
a) <thead>
b) <tfoot>
c) <tbody>
d) <table>
c) <tbody>
What is the default alignment of table text?
a) Left
b) Center
c) Right
d) Justified
a) Left
Which CSS property removes space between table cells?
a) border-spacing: 0;
b) border-collapse: collapse;
c) table-collapse: merge;
d) spacing: 0;
b) border-collapse: collapse;.