Font size
WorksheetsSY26 KP HTML5/CSS Study Guide
Total questions: 44
Worksheet time: 31mins
Which of the following can be placed inside a <table> tag?
Select all that apply.
none of these
images
other tables
text
Why is it important to include a proper <!DOCTYPE> declaration at the beginning of an HTML document?
It guarantees that embedded videos and audios will play correctly.
It optimizes the document for mobile viewing.
It ensures compatibility with all web hosting servers.
It provides a standard to which the document will be validated.
HTML markup language is a set of Markup _____.
Attributes
Tags
Groups
Sets
What is the standard order for setting values in the shorthand property for margin and padding (e.g., margin: 10px 5px 15px 5px;)?
Right, Top, Left, Bottom
Top, Right, Bottom, Left
Bottom, Right, Top, Left
Right, Left, Top, Bottom
Top, Left, Bottom, Right
Which tag signifies the beginning of an HTML5 document?
<HTML5>
<!HTML>
<!DOCTYPE html>
<!DOCTYPE html4>
<html version='5'>
Which of the following is a correct way to comment out multiple lines in a CSS file?
-- This is a comment --
// This is a comment //
<!-- This is a comment -->
/* This is a comment */
# This is a comment #
Given the HTML below, how can a programmer style multiple elements inside the same container using CSS?
<div class="area">
<h1>Heading</h1>
<p>Paragraph text</p>
</div>
div.area h1{ font-family: Arial, Helvetica, sans-serif; }
.area { font-family: Arial, Helvetica, sans-serif; }
.area h1{ font-family: Arial, Helvetica;}
.area h1{font-family: Arial, Helvetica, sans-serif;}
If you want to load an external icon font library, which HTML tag would typically be used to reference it from a CDN?
<script src='...'></script>
<icon src='...'>
<font src='...'>
<link rel='stylesheet' href='...'>
<style src='...'>
What is the primary purpose of the <title> tag inside the <head> section of an HTML document?
To add a comment for developers.
To display a headline on the page.
To style the text inside the body.
To link external scripts.
To set the page's title as seen on browser tabs and search engine results.
In the CSS box model, which property defines the space between the border and the actual content?
gap
margin
border
padding
spacing
Which property can help in identifying elements that exceed their containing element's width, potentially causing layout issues?
border-radius: 50%;
overflow: hidden;
background-color: red;
outline: 1px solid red;
max-width: 100%;
What is the primary role of the <head> section in an HTML document?
To ensure website compatibility with all browsers
To display headers and navigation
To hold meta-information, links to stylesheets, and other non-visible data
To contain the website's main content
To provide the footer information
Which tag in an HTML form creates a dropdown list for users?
<list>
<dropdown>
<menu>
<select>
<optionlist>
For a list where items are marked with numbers, you would use:
<ul>
<ul type='I'>
<ol type='A'>
<ol>
<li type='1'>
Which tag is used to create an ordered list?
<ul>
<ol>
<list>
<dl>
<li>
To apply a background image to an element from a source named 'image.jpg', which of the following CSS codes is correct?
background-source: url('image.jpg');
background-img: url('image.jpg');
wallpaper: image.jpg;
backdrop: url('image.jpg');
background: url('image.jpg');
Which style is applied to the H1 heading by default ?
Italic
Bold
Bold and Underline
Underline
Which CSS property is used to define a container as a grid layout?
layout: grid;
display: grid;
display: flex;
box: grid;
display: block;
Where would you typically find an internal stylesheet?
Within the body content of an HTML document
Within the <script> tag
Within the <link> tag
Within an external .css file
Within the <head> section of an HTML document using the <style> tag
Which of the following tags is used to create an ordered list?
<li>
<olist>
<list>
<ul>
<ol>
Choose the correct difference between the <ul> and <ol> tags.
<ul> is for an unordered list, and <ol> is for an ordered list
<ol> is for a list of options to be presented to the user and <ul> is an ordered list
<ul> is used for creating unordered lists and <ol> is for tables
The only difference between the two is styling such as italics and bold text
Which ARIA attribute is used to specify that an element controls the appearance or disappearance of another element?
aria-hidden
aria-labelledby
aria-live
aria-label
aria-controls
Which of the following parts is not a valid part of the CSS box model?
Absolute
Padding
Border
Content
Order the HTML tags such that the largest heading is at the top and the smallest is at the bottom.
<h1>
<h2>
<h3>
<h4>
<h5>
Which pseudo-class targets only the element that the user is currently hovering over?
:active
:focus
:target
:hover
:over
Observe the following HTML code below. Which is the correct way to apply a CSS rule to set the margins to automatic?
<div class="section1">
Text Section
</div>
divsection1 { width: 100px; margin: auto; }
div{ section 1; width: 100px; margin: auto; }
div.section1 { width: 100px; margin: auto; }
div section 1 { width: 100px; margin: auto; }
Which CSS property allows you to set breakpoints for different screen sizes in responsive design?
@media
@break
breakpoints
sizes
media-queries
How does a web browser primarily interact with HTML 5 content?
By compressing the content for faster internet speeds
By rendering the defined structure and content for display to users
By converting it into machine code for execution
By translating it into different languages for global users
By saving the content for offline storage and retrieval
If you wanted to create a list with bullet points, which type of list would you use?
Unordered list
Checklist
Ordered list
Description list
Sequential list
If you want a hyperlink to open in a new browser tab or window, which attribute value would you use for the target attribute?
_top
_self
_parent
_blank
_new
If you have multiple elements you want to style in the same manner, which selector would be most appropriate?
ID selector
Inline style
Class selector
Element selector
Pseudo-class selector
Which HTML tag is used to create a form?
<textbox>
<form>
<fieldset>
<input>
<submit>
Which HTML tag is used to create a form?
<stylesheet href='styles.css'></stylesheet>
<link rel='stylesheet' type='text/css' href='styles.css'>
<style src='styles.css'></style>
<css src='styles.css'></css>
<link rel='stylesheet' type='text/html' href='styles.css'>
Which of the following is a key benefit of using external style sheets?
They allow for consistency across multiple web pages without repeating code.
They are easier to write than inline styles.
They improve the speed of website loading.
They can create animations and transitions.
They can store data for a website.
Observe the following code. Suggest one reason as to why there are 3 different classes in the snippet.
<div class="dropdown">
<button class="dropbutton">Dropdown</button>
<div class="dropdown-content">
<a href="http://www.link1.com">Site 1</a>
<a href="http://www.link1.com">Site 2</a>
</div>
</div>
The different classes are required otherwise an error would occur
They can each have an individual style applied to them
The classes are needed for the links to work
The div HTML attribute needs the classes to support it
If you wanted to set a backup or default font in case the browser does not support the first font choice, which method would you use?
font-choice: Arial or sans-serif;
font-selection: Arial, sans-serif;
font-set: Arial > sans-serif;
font-type: Arial; else sans-serif;
font-family: Arial, sans-serif;
Which type of CSS has the highest specificity in case of a conflict?
Universal selector CSS
Inline CSS
Internal stylesheet
Pseudo-class CSS
External stylesheet
Observe the code example below which creates two unordered lists containing some basic text. From the options below, select the snippet which will apply the same rule to both lists equally.
ul-names-ages { font-family: arial;}
ul { font-family: arial;}
ul-all { font-family: arial;}
ul_ { font-family: arial;}
A heading tag exists within the HTML with an id of ‘main_heading’. What would be the correct way to color it in blue with the CSS selector?
main_heading { color: blue; }
#main_heading { color: blue; }
#main_heading color: blue;
#main_heading { colorblue; }
Which attribute is recommended to be used with the <blockquote> tag to reference the source of the quotation?
href
quote
src
ref
cite
Which property is used in CSS to adjust the size of an icon that's implemented as a font character?
font-dimension
font-scale
font-size
icon-size
What is the relationship between the Content and the padding?
The contents styling is dictated by the padding
There is no relationship between content and padding
The padding creates spacing between the content and the border
The level of padding is always relative to the content above it
