Questions and Answers
What does CSS stand for?
Cascading Style Sheets
What is the correct HTML for referring to an external style sheet?
Where in an HTML document is the correct place to refer to an external style sheet?
In the
sectionWhich HTML tag is used to define an internal style sheet?
Signup and view all the answers
Which HTML attribute is used to define inline styles?
Signup and view all the answers
Which is the correct CSS syntax?
Signup and view all the answers
How do you insert a comment in a CSS file?
Signup and view all the answers
Which property is used to change the background color?
Signup and view all the answers
How do you add a background color for all
elements?
Signup and view all the answers
Signup and view all the answers
Which CSS property is used to change the text color of an element?
Signup and view all the answers
Which CSS property controls the text size?
Signup and view all the answers
What is the correct CSS syntax for making all
elements bold?
Signup and view all the answers
How do you display hyperlinks without an underline?
Signup and view all the answers
How do you make each word in a text start with a capital letter?
Signup and view all the answers
Which property is used to change the font of an element?
Signup and view all the answers
How do you make the text bold?
Signup and view all the answers
How do you display a border like this: The top border = 10 pixels, The bottom border = 5 pixels, The left border = 20 pixels, The right border = 1 pixel?
Signup and view all the answers
Which property is used to change the left margin of an element?
Signup and view all the answers
When using the padding property, are you allowed to use negative values?
Signup and view all the answers
How do you make a list that lists its items with squares?
Signup and view all the answers
How do you select an element with id 'demo'?
Signup and view all the answers
How do you select elements with class name 'test'?
Signup and view all the answers
How do you select all
elements inside a
Signup and view all the answers
How do you group selectors?
Signup and view all the answers
What is the default value of the position property?
Signup and view all the answers
Study Notes
CSS Basics
- CSS stands for Cascading Style Sheets.
- Correct HTML for an external style sheet:
<link rel="stylesheet" type="text/css" href="style.css">
- External style sheets are referred to in the
<head>
section of an HTML document.
Internal and Inline Styles
- The
<style>
tag is used to define an internal style sheet. - Inline styles are defined using the
style
attribute directly within an HTML tag.
CSS Syntax
- Correct CSS syntax example:
body {color: black;}
- Comments in a CSS file:
/* This is a comment */
Color and Background
- The property used to change the background color:
background-color
. - To add a background color for all
<h1>
elements:h1 {background-color: #FFFFFF;}
Text Properties
- The CSS property for changing the text color:
color
. - The property controlling text size:
font-size
. - Making all
<p>
elements bold:p {font-weight: bold;}
Text Decoration and Capitalization
- Display hyperlinks without an underline:
a {text-decoration: none;}
- To capitalize each word in a text:
text-transform: capitalize;
Font Properties
- Font can be changed using
font-family
orfont
. - To make text bold:
font-weight: bold;
Borders and Margins
- Syntax for custom border widths:
border-width: 10px 1px 5px 20px;
- Change the left margin of an element:
margin-left
.
Padding and Lists
- Negative values are not allowed when using the padding property.
- To create a list with square items:
list-style-type: square;
Selecting Elements
- To select an element with id "demo":
#demo
. - To select elements with class name "test":
.test
. - Select all
<p>
elements inside a<div>
:div p
.
Grouping and Positioning
- Group selectors by separating them with a comma.
- The default value of the position property in CSS:
static
.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
Test your knowledge of CSS with this quiz! Covering topics such as the meaning of CSS, how to link external stylesheets, and more, this quiz is perfect for beginners looking to sharpen their web design skills.