WorksheetsCreating a website | Introduction to CSS
Total questions: 32
Worksheet time: 17mins
Which of the following is the correct file extension for an HTML file?
.htl
.html
.htm
Both B and C
HTML is considered which type of language?
Programming Language
Markup Language
Styling Language
Scripting Language
Which part of an HTML document is visible in the web browser?
<head>
<body>
<title>
<meta>
Which HTML tag is used to create a hyperlink?
<link>
<a>
<href>
<url>
Which of the following is the correct tag to create a new paragraph in HTML?
<p>
<div>
<br>
<para>
What is the purpose of the <title> tag in an HTML document?
To create a heading on the page
To specify the title of the document shown in the browser’s title bar
To insert a title for a paragraph
To link to a CSS file
Which tag is used to create a line break in HTML?
<lb>
<br>
<break>
<newline>
What tag is used to display an image in HTML?
<picture>
<img>
<image>
<src>
Which HTML tag is used to create a numbered list?
<ul>
<ol>
<li>
<list>
Which tag is used to create a heading in an HTML document?
<head>
<h1> to <h6>
<header>
<heading>
What is the correct way to create a hyperlink to www.example.com?
<a>www.example.com</a>
<a link="www.example.com">Example</a>
<a href="www.example.com">Example</a>
<link href="www.example.com">Example</link>
What is the correct HTML tag for inserting a line across the page?
<line>
<break>
<hr>
<divider>
Which of the following tags is used to create a table in HTML?
<tbl>
<tr>
<table>
<td>
How do you add a comment in HTML?
// This is a comment
<!-- This is a comment -->
/* This is a comment */
<comment>This is a comment</comment>
Which attribute is used to specify the URL of an image in the <img> tag?
src
href
link
url
What does the <meta> tag typically provide?
Information about the webpage, such as author and description
Styling for the webpage
Main content of the page
A link to another webpage
Which HTML attribute is used to define inline styles?
css
style
class
id
How do you specify an external CSS file in an HTML document?
<style src="styles.css">
<css href="styles.css">
<link rel="stylesheet" href="styles.css">
<stylesheet src="styles.css">
What does CSS stand for?
Computer Style Sheets
Cascading Style Sheets
Colorful Style Sheets
Creative Style Sheets
Which of the following is the correct CSS syntax to set a background colour to blue?
background: blue;
bg-color: blue;
color: blue;
background-color: blue;
Which property is used to change the text color in CSS?
text-color
font-color
color
text-style
What does :hover pseudo-class do in CSS?
Selects an element when it's clicked
Selects an element when it's hovered over by the mouse
Selects the first element of a specified type
Selects an element when it has focus
Which property is used to change the font size of an element?
text-size
font-style
font-size
text-style
How do you make the text bold in CSS?
font-weight: bold;
text-bold: true;
font-style: bold;
text-weight: bold;
Match the following
padding
Add space inside an element, between the
margin
Controls the space outside of an element
font-size
Property is used to change the font size
line-height
Specify the space between lines of text
background-image: url("image.jpg");
Set the background image of a webpage i
What is the primary difference between internal and external CSS?
Internal CSS uses different syntax
External CSS is placed in a separate file
Internal CSS only works on certain browsers
External CSS requires JavaScript
Which of the following is an advantage of external CSS?
Faster initial page load
Easier to maintain across multiple pages
Better for small, single-page websites
Simpler to implement for beginners
What is a disadvantage of internal CSS?
It cannot be cached by browsers
It requires additional HTTP requests
It's not reusable across multiple pages
It's slower to load than external CSS
Which method of CSS implementation is generally preferred for large websites?
Inline CSS
Internal CSS
External CSS
Mixed CSS
What is an advantage of internal CSS over external CSS?
Better performance for single-page websites
Easier to manage for large projects
More compatible with older browsers
Allows for more complex selectors
What is a potential disadvantage of external CSS?
It cannot be used for responsive design
It may require an additional HTTP request
It's more difficult to implement than internal CSS
It doesn't work on all browsers
In terms of code organization, what is an advantage of external CSS?
It keeps HTML files smaller and cleaner
It allows for faster rendering of web pages
It provides better browser compatibility
It eliminates the need for media queries
