w3schools CSS quiz, W3Schools HTML Quiz
which doctype is correct for HTML5?
<!DOCTYPE html>
What is the correct HTML for creating a hyperlink?
<a href="http://www.w3schools.com">W3Schools</a>
What is the correct HTML element for inserting a line break?
<br>
What is the correct HTML element to define emphasized text?
<em>
Which of these elements are all <table> elements?
<table><tr><td>
13. How do you display hyperlinks without an underline? a {decoration:no-underline;} a {text-decoration:none;} a {text-decoration:no-underline;} a {underline:none;}
a {text-decoration:none;}
18. Which property is used to change the left margin of an element? indent padding-left margin-left
margin-left
In HTML, which attribute is used to specify that an input field must be filled out?
required
5. Which HTML attribute is used to define inline styles? style font class styles
style
21. How do you select an element with id "demo"? #demo demo *demo .demo
#demo
Which HTML element is used to specify a header for a document or section?
<header>
Which HTML element defines the title of a document?
<title>
How can you make a bulleted list?
<ul>
What is the correct HTML element for playing video files?
<video>
15. Which property is used to change the font of an element? font-family Both font-family and font can be used font
Both font-family and font can be used
1. What does CSS stand for? Colorful Style Sheets Cascading Style Sheets Computer Style Sheets Creative Style Sheets
Cascading Style Sheets
In HTML, what does the <aside> element define?
Content aside from the page content.
The HTML <canvas> element is used to ______?
Draw Graphics
In HTML, onblur and onfocus are _______ ?
Event Attributes
True or False: Block elements are normally displayed without starting a new line.
False
What does HTML stand for?
Hyper Text Markup Language
3. Where in an HTML document is the correct place to refer to an external style sheet? At the end of the document In the <head> section In the <body> section
In the <head> section
19. When using the padding property; are you allowed to use negative values?
No
24. How do you group selectors? Separate each selector with a comma Separate each selector with a space Separate each selector with a plus sign
Separate each selector with a comma
True or False: An <iframe> is used to display a web page within a web page.
True
True or False: HTML comments start with a <!-- and end with -->
True
True or False: In HTML, you can embed SVG elements directly into an HTML page.
True
True or False: Inline elements are normally displayed without starting a new line.
True
Which HTML attribute specifies an alternate text for an image, if the image cannot be displayed?
alt
8. Which property is used to change the background color? color bgcolor background-color
background-color
6. Which is the correct CSS syntax? {body:color=black;} body:color=black; body {color: black;} {body;color:black;}
body {color: black;}
17. 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 = 1pixel? border-width:10px 5px 20px 1px; border-width:10px 20px 5px 1px; border-width:5px 20px 10px 1px; border-width:10px 1px 5px 20px;
border-width:10px 1px 5px 20px;
10. Which CSS property is used to change the text color of an element? color fgcolor text-color
color
23. How do you select all p elements inside a div element? div + p div p div.p
div p
11. Which CSS property controls the text size? text-size font-size text-style font-style
font-size
16. How do you make the text bold? style:bold; font:bold; font-weight:bold;
font-weight:bold;
20. How do you make a list that lists its items with squares? list-type: square; list-style-type: square; list: square;
list-style-type: square;
12. What is the correct CSS syntax for making all the <p> elements bold? p {font-weight:bold;} <p style="font-size:bold;"> <p style="text-size:bold;"> p {text-size:bold;}
p {font-weight:bold;}
22. How do you select elements with class name "test"? test *test #test .test
.test
Which character is used to indicate an end tag?
/
7. 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
/* this is a comment */
How can you open a link in a new tab/browser window?
<a href="url" target="_blank">
What is the correct HTML element for playing audio files?
<audio>
What is the correct HTML for adding a background color?
<body style="background-color:yellow;">
What is the correct HTML element for the largest heading?
<h1>
What is the correct HTML for inserting an image?
<img src="image.gif" alt="MyImage">
What is the correct HTML for making a checkbox?
<input type="checkbox">
What is the correct HTML for making a text input field?
<input type="text">
2. What is the correct HTML for referring to an external style sheet? <link rel="stylesheet" type="text/css" href="mystyle.css"> <style src="mystyle.css"> <stylesheet>mystyle.css</stylesheet>
<link rel="stylesheet" type="text/css" href="mystyle.css">
Which HTML element is used to display a scalar measurement within a range?
<meter>
Which HTML element defines navigation links?
<nav>
How can you make a numbered list?
<ol>
What is the correct HTML for making a drop-down list?
<select>
What is the correct HTML element to define important text?
<strong>
4. Which HTML tag is used to define an internal style sheet? <script> <style> <css>
<style>
Graphics defined by SVG is in which format?
XML
9. How do you add a background color for all <h1> elements? h1.all {background-color:#FFFFFF;} h1 {background-color:#FFFFFF;} all.h1 {background-color:#FFFFFF;}
h1 {background-color:#FFFFFF;}
Which input type defines a slider control?
range
14. How do you make each word in a text start with a capital letter? You can't do that with CSS text-transform:uppercase text-transform:capitalize
text-transform:capitalize
What is the correct HTML for making a text area?
<textarea>
Who is making the Web standards?
The World Wide Web Consortium
What is the correct HTML for inserting a BACKGROUND image?
<body style="background-image:url(background.gif)">
Which HTML element is used to specify a footer for a document or section?
<footer>
The HTML global attribute, "contenteditable" is used to _____ ?
Specify whether the content of an element should be editable or not.
25. What is the default value of the position property? static absolute fixed relative
static