CSS and HTML Styling Fundamentals
Test your knowledge of CSS syntax, properties, and HTML styling including selectors, margins, padding, fonts, colors, and stylesheet integration methods.
Questions
Question 1 Multiple Choice (Single Answer)
- What is the correct HTML for referring to an external style sheet?
- <stylesheet>mystyle.css</stylesheet>
- <link rel="stylesheet" type="text/css" href="mystyle.css">
- <style src="mystyle.css">
- None of the above
Question 2 Multiple Choice (Single Answer)
- Where in an HTML document is the correct place to refer to an external style sheet?
- At the top of the document
- In the <head> section
- At the end of the document
- In the <body> section
Question 3 Multiple Choice (Single Answer)
- Which HTML tag is used to define an internal style sheet?
- <style>
- <css>
- <script>
- None of the above
Question 4 Multiple Choice (Single Answer)
- Which HTML attribute is used to define inline styles?
- style
- font
- class
- styles
Question 5 Multiple Choice (Single Answer)
Which is the correct CSS syntax?
- body {color: black}
- {body;color:black}
- {body:color=black(body}
- body:color=black
Question 6 Multiple Choice (Single Answer)
How do you insert a comment in a CSS file?
- // this is a comment
- /* this is a comment */
- // this is a comment //
- ' this is a comment
Question 7 Multiple Choice (Single Answer)
How do you add a background color for all
elements?
- h1 {background-color:#FFFFFF}
- all.h1 {background-color:#FFFFFF}
- h1.all {background-color:#FFFFFF}
- None of the above
Question 8 Multiple Choice (Single Answer)
How do you change the text color of an element?
- fgcolor:
- text-color:
- color:
- text-color=
Question 9 Multiple Choice (Single Answer)
Which CSS property controls the text size?
- text-style
- text-size
- font-size
- font-style
Question 10 Multiple Choice (Single Answer)
What is the correct CSS syntax for making all the
elements bold?
- <p style="text-size:bold">
- p {font-weight:bold}
- <p style="font-size:bold">
- p {text-size:bold}
Question 11 Multiple Choice (Single Answer)
How do you change the font of an element?
- font=
- f:
- font-family:
- None of the above
Question 12 Multiple Choice (Single Answer)
How do you make the text bold?
- style:bold
- font:b
- font-weight:bold
- None of the above
Question 13 Multiple Choice (Single Answer)
How do you change the left margin of an element?
- indent:
- text-indent:
- margin-left:
- margin:
Question 14 True/False
To define the space between the element's border and content, you use the padding property, but are you allowed to use negative values?
- True
- False
Question 15 Multiple Choice (Single Answer)
6.What is the fullform of W3C?
- (A)World Wide Web Consortium
- (B)World Wide Web Company
- (C)World Wide Web Center
- (D)World Wide Web Command
- (E)None of them