What Do You Know About HTML And CSS? Trivia Questions Quiz

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Catherine Halcomb
Catherine Halcomb
Community Contributor
Quizzes Created: 1443 | Total Attempts: 6,714,231
| Attempts: 305 | Questions: 38
Please wait...
Question 1 / 38
0 %
0/100
Score 0/100
1. What is the difference between HTML and CSS?

Explanation

HTML and CSS are both essential components of web development, but they serve different purposes. HTML (Hypertext Markup Language) is responsible for structuring the content of a website, such as text, images, and links. It defines the elements and their arrangement on the page.

On the other hand, CSS (Cascading Style Sheets) is used to control the presentation and appearance of the HTML elements. It handles the formatting, layout, and design aspects of a website, including colors, fonts, spacing, and positioning.

Therefore, the correct answer states that HTML deals with the content of the site (structure) while CSS handles the form (presentation).

Submit
Please wait...
About This Quiz
What Do You Know About HTML And CSS? Trivia Questions Quiz - Quiz

What do you know about HTML and CSS? Most people get confused when it comes to differentiating between the two and them major difference is that one webpage language while the other is format for the layout of the said webpages. This trivia questions quiz is exactly what you need... see morein order to understand the two much deeper. How about you give it a try and see how well you do! see less

Tell us your name to personalize your report, certificate & get on the leaderboard!
2. In CSS and HTML colors are displayed by combining these three shades of light?

Explanation

In CSS and HTML, colors are displayed by combining red, green, and blue shades of light. This combination of RGB values allows for the creation of a wide range of colors by varying the intensity of each shade. By manipulating the intensity of red, green, and blue, different colors can be achieved, giving web designers and developers the ability to create visually appealing and customized color schemes for their websites.

Submit
3. Which is the correct CSS syntax?

Explanation

The correct CSS syntax is "body { color: black; }". In CSS, selectors are used to target specific elements, and in this case, the selector is "body". The curly braces {} are used to enclose the declaration block, which contains the property "color" and its corresponding value "black". This syntax follows the standard CSS syntax for applying styles to the body element.

Submit
4. How do you refer to an element inside of an element?

Explanation

When referring to an element inside of another element, it is commonly referred to as "the child". This term is used to describe the relationship between the two elements, where the inner element is considered to be a child of the outer element. This terminology is widely used in programming and web development to describe the hierarchical structure of elements within a document or code.

Submit
5. What is the purpose of a class?

Explanation

The purpose of a class is to give multiple elements the same style. Classes are used in HTML and CSS to apply a specific style to multiple elements without having to repeat the style for each individual element. By assigning the same class to multiple elements, you can easily apply consistent styling across those elements. This helps in maintaining a uniform design and makes it easier to update the style in one place, rather than modifying each element individually.

Submit
6. In CSS, how would you select only the paragraphs with class name "warning"?
<p class="warning">Don't do it.</p>
<p>Do it.</p>
<p class="warning">Nooo, don't do it.</p>

Explanation

The correct answer is ".warning { }". This is the correct CSS selector to select only the paragraphs with the class name "warning". The "." indicates that it is a class selector, and "warning" is the name of the class that we want to select.

Submit
7. P.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Roboto Light'; color: #000000; -webkit-text-stroke: #000000; background-color: #ffffff} span.s1 {font-kerning: none} Which CSS property controls the text size?

Explanation

The CSS property "font-size" controls the size of the text. It allows you to specify the desired size of the font in pixels, ems, rems, or other units. By adjusting the value of "font-size", you can make the text appear larger or smaller on the webpage.

Submit
8. Which of the following selects all elements with the class "cats-siamese" ?

Explanation

The correct answer is ".cats-siamese" because the dot (.) is the selector for class in CSS. So, ".cats-siamese" selects all elements with the class "cats-siamese".

Submit
9. What is the correct CSS syntax for making all the < p > elements bold?

Explanation

The correct CSS syntax for making all the

elements bold is "p { font-weight:bold; }". This is because the "font-weight" property is used to specify the weight or thickness of the font, and the value "bold" makes the text appear in a bold font weight. The other options provided in the question are incorrect.

Submit
10. Which position property will affix the element to the browser's window?

Explanation

The correct answer is "fixed". The "fixed" position property will affix the element to the browser's window, meaning that it will stay in the same position even when the user scrolls the page. This can be useful for creating elements that should always be visible, such as navigation bars or headers.

Submit
11. How do you select elements with the class of "muppets"?

Explanation

To select elements with the class of "muppets", we use the CSS selector ".muppets". The dot (.) represents the class selector in CSS, and by prefixing it with the class name "muppets", we can target and select all elements that have this class assigned to them.

Submit
12. How do you select an element with the id of "elmo"?

Explanation

To select an element with the id of "elmo", you would use the CSS selector "#elmo". The "#" symbol is used to target elements by their id attribute, and "elmo" is the specific id value that you are selecting.

Submit
13. How do you group more than one selector?

Explanation

Remember adding a default style to html, body { padding:0; margin:0; border:0; }?

Submit
14. In CSS, how would you select all the <p> tags on a page?

Explanation

The correct answer is "p { }". This is the correct CSS syntax for selecting all the

tags on a page. The "p" represents the HTML element selector for paragraphs, and the curly braces {} indicate the block of CSS rules to be applied to the selected elements.

Submit
15. P.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Roboto Light'; color: #000000; -webkit-text-stroke: #000000; background-color: #ffffff} span.s1 {font-kerning: none} 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?

Explanation

The correct answer is "border-width:10px 1px 5px 20px;". This answer correctly follows the order of specifying the border widths for the top, right, bottom, and left sides respectively. In this case, the top border is 10 pixels, the right border is 1 pixel, the bottom border is 5 pixels, and the left border is 20 pixels.

Submit
16. How do you display hyperlinks without an underline?

Explanation

The correct answer is "a { text-decoration:none; }". This CSS code is used to remove the underline from hyperlinks. The "text-decoration" property is used to specify the decoration of text, and setting it to "none" removes any underline.

Submit
17. P.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Roboto Light'; color: #000000; -webkit-text-stroke: #000000; background-color: #ffffff} span.s1 {font-kerning: none} What is the correct HTML for referring to an external style sheet?

Explanation

The correct HTML for referring to an external style sheet is . This code uses the tag with the attributes rel="stylesheet" to specify that it is a style sheet, type="text/css" to indicate the file type, and href="drogon.css" to specify the file name and location.

Submit
18.  How do you make each word in a text start with a capital letter?

Explanation

The correct answer is "text-transform:capitalize". This CSS property is used to make the first letter of each word in a text start with a capital letter. The "text-transform" property allows for various transformations of text, and "capitalize" specifically targets the first letter of each word.

Submit
19. What does CSS stand for?

Explanation

CSS stands for Cascading Style Sheets. It is a style sheet language used for describing the look and formatting of a document written in HTML or XML. CSS allows web designers to separate the content of a webpage from its presentation, making it easier to control the layout and appearance of multiple web pages at once. The "cascading" in CSS refers to the ability to define multiple styles for an element and have them cascade or apply in a specific order, allowing for flexibility and customization in web design.

Submit
20. Which of the following is true about IDs?

Explanation

All of the statements mentioned are true about IDs. IDs are designed for single elements, meaning that each element can have a unique ID. IDs have more specificity than classes, which means that if there is a conflict between the two, the styles defined by the ID will take precedence. An element with an ID can be invoked or accessed using JavaScript or CSS to apply specific styles or perform specific actions.

Submit
21. The text-transform property can be used to...

Explanation

The text-transform property in CSS can be used to change the appearance of the text by transforming it to uppercase. This means that all the letters in the text will be converted to uppercase letters, giving it a capital letter format. This property is useful when we want to display text in a consistent and standardized manner, regardless of how it is originally written.

Submit
22. P.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Roboto Light'; color: #000000; -webkit-text-stroke: #000000; background-color: #ffffff} span.s1 {font-kerning: none} Which of the following will turn the selected elements' text red?

Explanation

The correct answer is "color: red;". This CSS property sets the color of the text content of the selected elements to red. The other options mentioned, such as "text-color", "font-color", and "text-decoration: color('red')" are not valid CSS properties for changing the color of the text.

Submit
23. Which HTML tag is used to define an internal stylesheet?

Explanation

The

Submit
24. An element's padding is specified as "1px 2px 3px 4px". Which value represents the left side of the element?

Explanation

Measurements proceed clockwise from the upper left for padding, margins and borders.

Submit
25. Will repeat-y will make the background image repeat side to side?

Explanation

x is horizontal axis, y is vertical axis

Submit
26. How do you select all p elements inside a div element?

Explanation

div + p is an adjacent sibling selector .div is not a class by itself

Submit
27. What is the default value of the position property?

Explanation

The default value of the position property is "static". This means that an element will be positioned according to the normal flow of the document. It will not be affected by the top, bottom, left, right, or z-index properties.

Submit
28. I want to center my text I can use which property to do this?

Explanation

The text-align property can be used to center the text.

Submit
29. What is the name of the property that is used to define the special state of an element?

Explanation

A pseudo-class is a property that is used to define the special state of an element. It is used to select and style elements based on their state or position in the document. Pseudo-classes are added to selectors to specify a specific state or condition of an element, such as when it is being hovered over or when it is the first child of its parent.

Submit
30. In the following code when will the cursor change to a pointer? p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.0px; font: 13.0px Arial; color: #333333; -webkit-text-stroke: #333333; background-color: #ffffff} span.s1 {font-kerning: none} < div style =" width:100px;height:100px; " > < a href = " https://www.google.com " >Link< /a > < /div >  

Explanation

The default behavior from the browser (the user agent stylesheet) is for the cursor to change to a pointer when it is an anchor tag. As the anchor tag is wrapped around the word Link that will also be affected by the anchor tag.

Submit
31. What selector combination would you use to style 'oranges'? < div >     < div >     < p > I like < span > oranges< /span >< /p > < ol >         < li > My favorite color is < span > blue< /span >< /li >  < /ol >     < p >I like < span >grapes< /span >< /p > <  /div  > <  /div  >

Explanation

The correct selector combination to style 'oranges' would be div div p span. This combination selects the span element within the p element within the second div element within the first div element.

Submit
32. Which of the following has the right order and names for the four kinds of links?

Explanation

The correct order and names for the four kinds of links are "Link, Visited, Hover, Active". This is because when a user interacts with a link, it first appears as a normal link (Link), then if the user has already visited the link, it changes appearance (Visited). When the user hovers over the link, it may have a different appearance (Hover), and when the user clicks on the link, it may have an active state (Active).

Submit
33. Which of the following would add a comment to the CSS?

Explanation

// can add a single line comment by itself but does not have a closing //

Submit
34. Which box-sizing value forces any padding and border-width values into the width and height of an element?

Explanation

The correct answer is "border-box". This value for the box-sizing property forces any padding and border-width values to be included within the specified width and height of an element. In other words, the total width and height of the element will be calculated by adding the specified width and height values to the padding and border widths. This is useful when you want to ensure that the overall size of an element remains consistent, regardless of any padding or border that may be added.

Submit
35.
Which one of these will select nephew?
< div class="aunt" >
    < div class="cousin" >
     < div class="nephew" > ...< /div >
    < /div > 
< /div >

Explanation

The correct answer: .aunt SPACE .nephew will select ANY descendent of aunt that is a class of nephew .aunt.nephew would match any element with both classes < div class="aunt nephew" >...< /div > .aunt>.nephew only effects the direct child, the direct child in the example shown is cousin

Submit
36. Which of the following selects all elements with both "gallery" and "sculpture" classes?

Explanation

The correct answer is ".gallery.sculpture" because the dot (.) is used to select elements with a specific class, and the combination of ".gallery" and ".sculpture" means selecting elements that have both the "gallery" and "sculpture" classes.

Submit
37. P.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Roboto Light'; color: #000000; -webkit-text-stroke: #000000} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Roboto Light'; color: #000000; -webkit-text-stroke: #000000; min-height: 14.0px} span.s1 {font-kerning: none} The final appearance of a web page is a result of different styling rules.  Which one of the following is NOT a source of style information that form the cascade?

Explanation

The final appearance of a web page is determined by the combination of different styling rules. These styling rules can come from various sources such as inline styles specified by the user in the HTML, the stylesheet created by the author of the page, and the browser's default styles. However, a default style from the server is not a source of style information that forms the cascade.

Submit
38. If I use box-size:border-box what will happen?

Explanation

When the box-sizing property is set to border-box, the padding will not affect the size of the boxes. Normally, when padding is added to a box, it increases the total size of the box. However, with border-box, the padding is included in the specified width and height of the box. This means that the content area of the box will be reduced to accommodate the padding, keeping the overall size of the box unchanged.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 21, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Oct 19, 2017
    Quiz Created by
    Catherine Halcomb
Cancel
  • All
    All (38)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
What is the difference between HTML and CSS?
In CSS and HTML colors are displayed by combining these three shades...
Which is the correct CSS syntax?
How do you refer to an element inside of an element?
What is the purpose of a class?
In CSS, how would you select only the paragraphs with class name...
P.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Roboto Light';...
Which of the following selects all elements with the class...
What is the correct CSS syntax for making all the < p > elements...
Which position property will affix the element to the browser's...
How do you select elements with the class of "muppets"?
How do you select an element with the id of "elmo"?
How do you group more than one selector?
In CSS, how would you select all the <p> tags on a...
P.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Roboto Light';...
How do you display hyperlinks without an underline?
P.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Roboto Light';...
 How do you make each word in a text start with a capital letter?
What does CSS stand for?
Which of the following is true about IDs?
The text-transform property can be used to...
P.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Roboto Light';...
Which HTML tag is used to define an internal stylesheet?
An element's padding is specified as "1px 2px 3px 4px"....
Will repeat-y will make the background image repeat side to side?
How do you select all p elements inside a div element?
What is the default value of the position property?
I want to center my text I can use which property to do this?
What is the name of the property that is used to define the special...
In the following code when will the cursor change to a pointer?...
What selector combination would you use to style 'oranges'?...
Which of the following has the right order and names for the four...
Which of the following would add a comment to the CSS?
Which box-sizing value forces any padding and border-width values into...
Which one of these will select nephew?...
Which of the following selects all elements with both...
P.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Roboto Light';...
If I use box-size:border-box what will happen?
Alert!

Advertisement