0% found this document useful (0 votes)
33 views15 pages

CSS and HTML Quiz Questions

The document is an assessment titled 'Front-R38-Test-4' with a total score of 80/100, featuring multiple-choice questions related to HTML and CSS concepts. It includes questions about the inclusion of libraries, CSS properties, element behaviors, and layout techniques. The test assesses knowledge on various topics such as z-index, opacity, and styling elements in web development.

Uploaded by

naderbimeen
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views15 pages

CSS and HTML Quiz Questions

The document is an assessment titled 'Front-R38-Test-4' with a total score of 80/100, featuring multiple-choice questions related to HTML and CSS concepts. It includes questions about the inclusion of libraries, CSS properties, element behaviors, and layout techniques. The test assesses knowledge on various topics such as z-index, opacity, and styling elements in web development.

Uploaded by

naderbimeen
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

3/7/25, 9:55 PM Front-R38-Test-4

80/100 ‫إجمالي النقاط‬ Front-R38-Test-4

* / ‫االسم رباعي بالعربي‬

‫بيمن نادر جاد بشندي‬

* / id

285222251113

2/2 Based on the provided HTML structure, is the Font Awesome library -1
?correctly included

A) Yes, because css/[Link] contains Font Awesome styles.

B) Yes, because [Link] is the correct Font Awesome file.

C) Yes, because the link elements load external stylesheets, including Font
Awesome.

D) Yes, because any CSS file can contain Font Awesome by default.

E) None of the above choices are correct.

2/2 In the given HTML and CSS, will the background color of .title2 change -2
?to red when hovering over .div10

A) Yes, because .div10:hover .title2 correctly targets all .title2 elements on hover.

B) Yes, because .title2 inside .div10 will be affected when hovering over .div10.

C) Yes, because .title2 is a global class and applies everywhere inside .div10.

D) Yes, because any element with .title2 will change color when hovering over
.div10.

E) None of the above choices are correct.

[Link] 1/15
3/7/25, 9:55 PM Front-R38-Test-4

2/2 ?What happens when an element with class .a1 is focused -3

A) It disappears.

B) Its color changes to yellow.

C) Its font size increases.

D) It moves to a new position.

E) None of the above choices are correct.

0/2 ?What will happen when hovering over .div10 -4

A) .title1 will smoothly fade in when hovering over .div10.

B) .title1 will appear instantly without any transition effect.

C) .title1 will remain hidden and will not take up space even on hover.

D) .title1 will remain invisible, but it will reserve space when .div10 is hovered.

E) None of the above choices are correct.

0/2 ?What will happen when the given CSS code is executed -5

A) The element will become fully visible when hovering over .div10.

B) The element will not appear because display: none; prevents transitions.

C) The transition will work, but only opacity and visibility will change.

D) The element will flicker due to conflicting display and opacity settings.

E) None of the above choices are correct

[Link] 2/15
3/7/25, 9:55 PM Front-R38-Test-4

2/2 ?What is the position property of DIV1 in the given image -6

A) position: absolute;

B) position: relative;

C) position: fixed;

D) position: sticky;

E) None of the above choices are correct.

0/2 The shape in the image consists of three <div> elements. What CSS -7
properties are applied to these three <div> elements to achieve this
?layout

b) a)

d) c)

E) None of the above choices


are correct.

[Link] 3/15
3/7/25, 9:55 PM Front-R38-Test-4

0/2 In the given HTML and CSS code, will the Facebook icon change its -8
?color to red

A) Yes, the icon will change to red because the <i> tag is styled with color: red;.

B) Yes, since the i selector applies to all <i> elements, including Font Awesome
icons.

C) The color will change, but only if the .i1 class is removed.

D) The color will change only if additional styles are applied to .i1.

E) None of the above choices are correct.

0/2 ?What will happen when the given HTML and CSS code is executed -9

A) The background image will be displayed correctly inside the div.

B) The image might not load because the file format is incorrect.

C) The div will show the image but with incorrect dimensions.

D) The background image will appear only if background-size is set to cover.

E) None of the above choices are correct.

[Link] 4/15
3/7/25, 9:55 PM Front-R38-Test-4

0/2 Which of the following CSS codes correctly centers the images in the -10
?middle of the page

B) a)

D) C)

E) None of the above choices


are correct.

2/2 In the given HTML and CSS code, will the list items be displayed with -11
?numbers

ِA) No, the ul selector in the <style> block removes the numbering.

B) The list will be displayed with bullet points instead of numbers.

C) The list style will not be applied due to conflicting styles.

D) Yes, the list items will be numbered because the inline style="list-style-type:
decimal;" overrides the CSS in <style>.

E) None of the above choices are correct.

[Link] 5/15
3/7/25, 9:55 PM Front-R38-Test-4

0/2 Based on the code in the image, which div will be on the top layer -12
?according to the z-index value

A) div1 (blue) because it has z-index: 50;

B) div2 (red) because it has z-index: 200;

C) div1 (green) because it has z-index: -1;

D) All divs will be arranged correctly according to their z-index values.

E) None of the above choices are correct.

[Link] 6/15
3/7/25, 9:55 PM Front-R38-Test-4

0/2 What will be displayed in the browser based on the given HTML and -13
?CSS code

b) a)

d) c)

E) None of the above choices


are correct.

2/2 What will be the output of the following CSS code snippet? span { -14
border: 1px solid red; outline: green dotted 6px ;}

a) All span elements will have a green thick border and a red outline

b) All span elements will have a outer green dotted border and an inner red
bordered

c) All span elements will have a red dotted border and an inner green border

d) All span elements will have an outer red border and inner green dotted border

2/2 . ............ The default position is -15

a) fixed

b) static

C) absolute

D) relative

[Link] 7/15
3/7/25, 9:55 PM Front-R38-Test-4

2/2 Which of the following is the correct syntax to display the hyperlinks -16
?without any underline

a {text-decoration : underline;}

a {decoration : no-underline;}

a {text-decoration : none}

None of the above

2/2 Which of the following property is used as the shorthand property for -17
?the padding properties

padding-left

padding-right

padding

All of the above

[Link] 8/15
3/7/25, 9:55 PM Front-R38-Test-4

2/2 What will be the expected output when the following code is executed -18
?in a web browser

B ِِA

D C

E) None of the above choices


are correct.

2/2 Choose the correct Css Properity for making a space between words -19
written in my website

line-spacing

&nbsb;

space

word-spacing

[Link] 9/15
3/7/25, 9:55 PM Front-R38-Test-4

2/2 ?Which element is used to get highlighted text in HTML -20

<u>

<mark>

<highlight>

<b>

2/2 to do float:left to some elements you have to make ..................... to -21


. parent

a. overflow: right

b. overflow: left

c. overflow:auto;

d. float:right;

2/2 ?What is the range of values for the "opacity" property in CSS -22

0 to 1

b. 10 to 100

c. 1 to 2

d. 1 to 100

2/2 ? to choose Gender you have to use ........... attribute -23

input

label

type="password"

type="radio"

2/2 ?Which tag is used to display a horizontal line in HTML .24

A. <line>

B. <hr>

C. <br>

D. <hl>

2/2 ?How can you make a list display horizontally in CSS .25

A. display: block;

B. list-style: inline;

C. display: inline;

D. list-style-type: horizontal;

2/2 ?What is the purpose of the z-index property in CSS .26

A. To set the transparency of an element

B. To control the stacking order of elements

C. To change the color of the element

D. To add spacing between elements

[Link] 10/15
3/7/25, 9:55 PM Front-R38-Test-4

2/2 ?Which tag is used to define a multi-line text input field in HTML .27

A. <input type="text">

B. <textarea>

C. <textbox>

D. <input type="textarea">

2/2 ?What will happen if two elements have the same z-index value .28

A. The last element in the HTML will appear on top.

B. The first element in the HTML will appear on top.

C. Both elements will overlap equally.

D. None of the above.

2/2 ?What is the default display value for a <span> element in HTML .29

A. block

B. inline

C. line

D. none

2/2 Which CSS property is used to control the space between letters in a .30
?text

A. text-spacing

B. letter-spacing

C. word-spacing

D. line-height

2/2 ?How do you add rounded corners to an element in CSS .31

A. corner-radius

B. border-rounding

C. border-radius

D. radius-corner

2/2 What is the attribute in an <iframe> tag specify The destination URL of .32
? the hyperlink

a. src

b. target

c. href

d. link

2/2 ?What is the purpose of the div tag .33

a. To create a division in a document.

b. To create a div container

c. To style a division with CSS

d. All of the above

[Link] 11/15
3/7/25, 9:55 PM Front-R38-Test-4

2/2 ............ to make element inside an element it is called -34

grouping

nesting

pseudo class

hover

2/2 Which value of the "display" property makes an element not be .35
displayed at all on
?the page

a. hidden

b. none

c. invisible

d. display: none;

2/2 Which CSS property is used to apply the "italic" to an element's text in .36
?CSS

a. font-style

b. italic

c. fant-style: italic;

d. text-decoration: italic;

2/2 ........................ hover is one of the .37

a. Attributes

b. selectors

c. pseudo classes

d. pseudo elements

0/2 .div1 {z-indix : 3; } .div2 {z-indix : 10; } .38

a. div2 will be over div1

b. div1 will be over div2

c. div2 will be over all cause it is last written in code .

d. nothing will happen

2/2 Which of the following is a characteristic of block-level elements in .39


?HTML

a. They do not start on a new line.

b. They are always enclosed within inline elements.

c. They take up the full width available.

d. They cannot contain any other elements.

2/2 Which pseudo-class is triggered when an element gains focus through )40
?keyboard navigation or user interaction

a. :hover

b. :focus

c. :active

d. :visited

[Link] 12/15
3/7/25, 9:55 PM Front-R38-Test-4

0/2 Which pseudo-class is triggered when the mouse button is pressed )41
?down on an element

a. :active

b. :hover

c. :focus

d. :target

2/2 ?What will the following CSS code do -42


element { width: 100px; height: 100px; background-color: red; margin:.
auto 0; }

A. Centers the element horizontally.

B. Centers the element vertically.

C. Throws an error because of invalid margin.

D. None of the above choices are correct.

2/2 ?What is the issue with this CSS rule -43

A. The none value for margin is invalid.

B. Resets all margins to 0.

C. Applies default margins to all elements.

D. The code works as expected.

2/2 css value used to give a background to the element -44

color

background-color

margin

red

2/2 ? css property that make the Event take time while happenning )45

a. hover

b. transition

c. Span

d. H1

2/2 ............ z-index is one of the )46

a. attribute selectors

b. attributes

c. pseudo classes

d. None of the above

[Link] 13/15
3/7/25, 9:55 PM Front-R38-Test-4

2/2 ............ one of normal value in font-weight )47

a. 639

b. 439

c. 400

d. 239

2/2 space between border and text : space between border and outline is )48
1:4

a. outline=52 , offset= 13

b. margin = 9 , outline-offset = 36

c. outline-offset = 52 , padding = 13

d. border = 52 , padding-top = 13

2/2 - The CSS property used to specify the transparency of an element is )49

a. visibility

b. overlay

c. opacity

d. transparece

2/2 ? which of the following measurements represents seconds -50

se

sec

seconds

none of all mentioned

‫ سياسة الخصوصية‬- ‫ شروط الخدمة‬- .Google ‫لم يتم إنشاء هذا المحتوى وال اعتماده من ِقبل‬

‫? اإلبالغ‬Does this form look suspicious

‫نماذج‬

[Link] 14/15
3/7/25, 9:55 PM Front-R38-Test-4

[Link] 15/15

Common questions

Powered by AI

CSS 'flexbox' provides significant advantages over traditional layout models by allowing elements to adapt automatically to the container's available space, thereby simplifying responsive design. It excels in distributing space within containers, particularly for elements with varying sizes, and provides alignment and layering features that traditional models lack. However, its primary limitation is performance in layouts that require older browser support and its relative ineffectiveness for two-dimensional layouts compared to CSS Grid. Its efficiency in managing one-dimensional layouts is unmatched but can result in complex code when heavily nested .

Relying solely on ':hover' effects to convey information in web applications can lead to usability issues, particularly for touchscreen and mobile device users where hovering is not possible. Additionally, ':hover' effects are not accessible to screen readers, which can make critical information inaccessible to visually impaired users. Such reliance can disrupt the user experience by making interactions on certain devices or for certain users unclear, potentially violating web accessibility standards .

The 'z-index' property controls the stacking order of positioned elements. An element with a larger 'z-index' value will appear in front of elements with lower values. This property is crucial for web design as it ensures that elements like modals or overlays are displayed on top of the rest of the page content. Mismanagement of 'z-index' can lead to improper layering and elements being obscured, impacting design consistency and user interaction .

CSS pseudoclasses, such as ':hover' and ':focus', apply styles to elements based on the state of user interaction. ':hover' is triggered when a user hovers over an element, and ':focus' is activated when an element, such as an input field, gains focus through interaction, like keyboard navigation. They provide visual feedback by altering styles dynamically, which enhances the user experience .

The positioning properties in CSS ('absolute', 'relative', 'fixed', 'sticky') define how an element is placed in the document. 'Relative' positions the element relative to its normal position, allowing offset without altering document flow. 'Absolute' positions relative to the nearest positioned ancestor, useful for elements needing specific placement. 'Fixed' attaches an element to the viewport, making it non-scrollable. 'Sticky' acts like 'relative' until a certain scroll position, then acts like 'fixed'. Each mode affects layout differently, offering varying flexibility and influencing how components behave during interactions like scrolling and resizing, which is vital for responsive design .

The 'box-shadow' property adds depth by creating shadow effects around elements, which can mimic the visual cue of elevation. This property can be applied to interactive elements like buttons or cards to create a sense of focus. A softer, subtler shadow can suggest a consistent surface, while deeper, crisp shadows can provide emphasis, drawing users' attention to clickable areas. Leveraging shadow variations can enhance user experience by subtly guiding focus and indicating hierarchy without aggressive visual clutter .

CSS's 'opacity' property, which ranges from 0 (transparent) to 1 (opaque), affects element transparency without removing elements from the document flow, which contrasts with 'display: none;' or 'visibility: hidden;'. Performance-wise, 'opacity' changes can leverage hardware acceleration for smoother transitions, which is beneficial for animations. Usability-wise, 'opacity' allows interaction with partially transparent elements, whereas 'display: none;' and 'visibility: hidden;' fully prevent user interaction. This makes 'opacity' adjustments more versatile for dynamic effects without disrupting the layout or functionality .

The 'display: none;' property is effective in removing elements from the document flow and hiding them from view, which is useful for dynamic content that should be initially hidden. However, because it removes elements from the flow, it can break the layout if not correctly managed. Furthermore, it does not allow for CSS transitions to reveal elements smoothly, as it does not reserve space or accept changes in visibility or opacity . This makes it less versatile compared to visibility adjustments when animation or smooth transitions are desired.

CSS media queries are crucial in responsive design as they allow styles to change based on device characteristics like width and resolution, enabling a fluid user experience across different devices. However, potential pitfalls include over-complicating CSS files with numerous breakpoints, which can lead to maintenance challenges. Poorly structured media queries might also cause inconsistent behavior if not meticulously tested across various devices. Using too many queries can also bloat CSS, potentially affecting load times and site performance, particularly on lower-end devices .

'Position: sticky;' can positively impact performance by reducing the need for JavaScript-based solutions for sticky elements, thus lowering scripting overhead and enhancing reactivity and rendering speed. Unlike fixed positioning that continuously recalculates position, 'position: sticky;' naturally toggles between 'relative' and 'fixed' based on scroll position, thus maintaining a smoother performance even with complex page layouts. It is ideal for elements like headers that should remain visible during scroll while simplifying DOM management .

You might also like