How will an older browser display a blue box which has been made semi-transparen
ID: 3801150 • Letter: H
Question
How will an older browser display a blue box which has been made semi-transparent using CSS 3 opacity?
a. Not display the block at all
b. Show a solid blue block rather than a semi-transparent one
c. Show the blue block and whatever is behind it
d. Show a solid black block
Which selector only applies to elements that follow an <h1> element?
a. h1>p { }
b. h1 p { }
c. h1+p { }
d. h1*p { }
Which selector applies to all links that are inside a
element?
a. div>a { }
b. div a { }
c. div+a { }
d. a div { }
Explanation / Answer
The opacity property setting the opacity level for an element and the opacity-level describes the transparency level, where 1 is not transparent, 0.5 is 50% transparent, and 0 is completely transparent. When using the opacity property to add transparency to the background of an element, all of its child elements become transparent as well. This can make the text inside a fully transparent element and hard to read. If you do not want to apply opacity to child elements, use RGBA color values instead. Example: background: rgba (76, 20, 200, 0.20);
Therefore answer c. Show the blue block and whatever is behind it
Sequential selectors can be combined with other kinds of selectors, type selectors and attribute selectors can occur inside the slashes, and sequential selectors themselves can be part of contextual or parent-child selectors.
To define a CSS adjacent selector, the plus sign is used. h1+p {color:blue;} this CSS code will format the first paragraph after any h1 headings as blue. h1>p selects any p element that is a direct child of an h1 element. h1+p will select the first p element that is a sibling (at the same level of the dom) as an h1 element.
h1+p { } this selector specifies that if one element is directly followed by another then apply the style. This applies the style only if the p element immediately precedes h1 element.
Therefore answer c. h1+p { }
Descendent selectors are very similar to child selectors, except that child selectors only select direct descendents; descendent selectors select suitable elements anywhere in the element hierarchy, not just direct descendents. The div element is the parent of all the others.
A CSS selector can contain more than one simple selector, between the simple selectors can include a combinator. There are four different combinators in CSS3 such as descendant selector (space), child selector (>), adjacent sibling selector (+), general sibling selector (~).
The descendant selector matches all elements that are descendants of a specified elements, the following example selects all <a> elements inside <div> elements. div a { }
The child selector selects all elements that are the immediate children of a specified elements, the following example selects all <a> elements that are immediate children of a <div> element. div > a { }
The adjacent sibling selector selects all elements that are the adjacent siblings of a specified element. Sibling elements must have the same parent element, and adjacent means immediately following. The following example selects all <a> elements that are placed immediately after <div> elements. div + a { }
The general sibling selector selects all elements that are siblings of a specified element. The following example selects all <a> elements that are siblings of <div> elements. div ~ a { }
Therefore answer b. div a { }
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.