HTML & CSS

HTML & CSS

University

20 Qs

quiz-placeholder

Similar activities

HTML & CSS

HTML & CSS

6th Grade - Professional Development

16 Qs

CSS quiz

CSS quiz

10th Grade - University

15 Qs

Pre-Test Module 4

Pre-Test Module 4

University

20 Qs

HTML CSS BOOTCAMP

HTML CSS BOOTCAMP

University

15 Qs

HTML_CSS

HTML_CSS

University

16 Qs

CSS Quiz

CSS Quiz

University

20 Qs

Web Development

Web Development

University

15 Qs

HTML & CSS quiz

HTML & CSS quiz

6th Grade - Professional Development

21 Qs

HTML & CSS

HTML & CSS

Assessment

Quiz

Computers

University

Hard

Created by

Phanideep Phanideep

Used 1+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Given the following HTML and CSS, what will be the result of applying the CSS?

     HTML:

           <div class="container">

  <p class="text">Text</p>

</div>

CSS:

      .container {

  display: grid;

  grid-template-columns: 1fr 2fr;

  grid-template-rows: 1fr 2fr;

        }

.text {

  grid-column: 2;

  grid-row: 1 / 3;

       }

a) The paragraph will span the entire height of the grid but only in the second column.

b) The paragraph will be positioned in the first row and second column.

c) The paragraph will occupy the first column and span both rows.

d) The paragraph will be placed in the second column and span two rows

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Given the following CSS, which rule will affect the :nth-of-type selector?
CSS:

     ul li:nth-of-type(odd) {

  color: red;

}

a) It will select and color the odd-numbered <li> elements within any <ul> in red.

b) It will select and color the even-numbered <li> elements within any <ul> in red.

c) It will select all <li> elements in odd-numbered <ul> only.

d) It will color all <li> elements in red regardless of their position.

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the outcome of the following CSS applied to the HTML element?

Html :

<div class="box">Content</div>
CSS :

.box {
  position: relative;
  top: 20px;
  left: 30px;
}
.box::before {
  content: "Prefix";
  position: absolute;
  top: -20px;
  left: -30px;
}

a) The "Prefix" content will be positioned relative to the box, extending beyond its top and left edges.

b) The "Prefix" content will be positioned within the box, overlapping the original content.

c) The "Prefix" content will not be visible because it’s positioned outside the box's area.

d) The box will be displaced by 20px from the top and 30px from the left.

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which CSS property is used to control the stacking order of positioned elements?

a) position

b) order

c) stack-order

d) z-index

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the effect of the following CSS on the <div> element?

html

<div class="element">Text</div>

css

.element {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  height: 200px;
}

a) The text will be stretched to fill the container and aligned at the center.

b) The text inside the <div> will be aligned to the end of the container and centered horizontally.

c)The text inside the <div> will be centered vertically and aligned to the start of the flex container.

d) The text will be centered horizontally and aligned to the end of the container.

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which CSS pseudo-class will select all <a> elements that have a visited link?

a) :link

b) :visited

c) :hover

d) :focus

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the visual result of this CSS rule on a block element?

css

.box {
  width: 100px;
  height: 100px;
  border: 5px solid red;
  box-sizing: border-box;
}

a) The element will have a total width and height of 100px, including the border.

b) The element will have a width and height of 90px due to the border.

c) The element will have an additional 10px padding inside the border.

d) The element will expand beyond 100px width and height to accommodate the 

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?