CSS Introduction
Cascading Style Sheets (CSS) is a style sheet language used for describing the look and formatting of a document written in a markup language.
CSS was developed by the World Wide Web Consortium (W3C).
CSS defines how the HTML elements are to be displayed.
Styles are normally saved in external .css files. External style sheets allow you to change the appearance and layout of all the pages in a Website, just by editing one single file.
CSS stands for Cascading Style Sheets. It is a language designed to format the layout of Web pages. It is used to enable the separation of presentation and content, which includes layout, colors, and fonts. They improve the accessibility of content, make it more flexible. CSS enables the specific look of HTML in the browser. CSS has lots of advantages. CSS is a great time-saver; you can write CSS once and then use the same sheet in multiple HTML pages. It provides multiple device compatibility; style sheets allow content to be optimized for more than one type of device.
In our CSS tutorial, you will learn how to use CSS to control the style and layout of multiple Web pages all at once. CSS was introduced together with HTML to provide a better way to style HTML elements.
Before you continue, you should have a basic knowledge about HTML because, with HTML tags, we create our pages, and with CSS, we give style to our tags. It means we make our page more beautiful. HTML is used to structure content while the CSS is used for structured formatting content. With CSS, we can change the color, background-color, font-size, etc. Our CSS guide provides some sections which cover the basic knowledge, CSS Properties, and Selectors.
Apply Link
Css Basic Quiz Answers
Start Quiz
Test your knowledge with W3docs’ basic quiz made especially for beginners in CSS. Pass the test and get a Certificate of achievement!
The Test
The test contains 20 questions and there is no time limit. The test is not official, it’s just a nice way to see how much you know about CSS.
Count Your Score
You will get 5% for each correct answer. At the end of the Quiz, your total score will be displayed out of 100% maximum score.
Enrich your knowledge
At the end of the quiz you can see all the questions with the right answers. There will also be notes about the answers which will lead you to the appropriate page on the platform to enrich your knowledge. Read our HTML tutorial if you are not sure that you are ready for the quiz.
1) CSS stands for
A) Cascading Style Sheets
B) Computer Style Sheets
C) Creative Style Sheets
D) Canvas Styling System
Ans. A
2) How to set a style for a certain HTML element with an id of “special”?
A) #special{ }
B) .special{ }
C) id.special{ }
D) element.id.special{ }
Ans. A
3) Which HTML tag specifies an internal style sheet?
Ans. A
5) How to remove the underline from hyperlinks using CSS?
A) a {underline:none}
B) a {decoration:no underline}
C) a {text-decoration:no underline}
D) a {text-decoration:none}
Ans. D
6) How can you add space between the border and inner content of the element?
A) margin
B) padding
C) border
D) spacing
Ans. B
7) How do you inform the browser you are creating a styling section with an internal style sheet?
A)
B)
C)
Ans. A
8) How to remove the underline from hyperlinks using CSS?
A) a {underline:none}
B) a {decoration:no underline}
C) a {text-decoration:no underline}
D) a {text-decoration:none}
Ans. D
9) Which HTML attribute specifies an inline style sheet?
A) style
B) in-style
C) font
D) class
Ans. A
10) Which is the correct syntax to make all
elements bold?
A) p style=”text-size:bold”
B) p {text-size:bold}
C) p style=”font-size:bold”
D) p {font-weight: bold}
Ans. D
11) In the following code snippet, what value is used for the left padding?
padding: 5px 15px 8px 10px
A) 10px
B) 5px
C) 15px
D) 8px
Ans. A
12) In the following code snippet, what value have we used for the bottom margin?
margin: 10px 8px 15px 9px;
A) 10px
B) 8px
C) 15px
D) 9px
Ans. C
13) Which property do you need to change the text color of an element?
A) color
B) text-color
C) font-color
D) fontcolor
Ans. A
14) Which property controls the size of a text?
A) font-size
B)font-style
C) text-size
D) text-style
Ans. A
15) Which selector do you need to define a style for multiple elements?
A) id
B) class
C) style
D) text
Ans. B
16) Which property do you need to change the background image?
A) background-image
B) background-color
C) background-img
D) backgroundimage
Ans. A
17) Which is the correct CSS syntax?
A) a {font-weight: bold; }
B) {a:font-weight: bold; }
C) a {font:weight: bold }
D) a :font:weight = bold;
Ans. A
18) How can you make a list not display bullets?
A) list-style-type: no-bullet
B) list-style-type: none
C) list: none
D) list-style-type: nobullet
Ans. B
19) Which is the correct syntax to set all the tags’ font-size to 13px?
A) a{font-size:13px;}
B) a{font:13px;}
C) a{size:13px;}
D) a{text-size:13px;}
Ans. A
20) How can you create a list displaying its items with squares?
A) type: square
B) list-style-type: square
C) style-list: square
D) list-type: square
Ans. B
21) How to make each word of the text start with a capital letter?
A) text-transform:uppercase
B) text-transform:capitalize
C) text-transform:lowercase
D) Can’t do that with CSS
Ans. B
22) Which CSS syntax is commonly used to center a website horizontally?
A) margin: 0 auto;
B) margin: auto 0;
C) site-align: center;
D) margin: center;
Ans. A