CODING CSS EXAM QUESTIONS AND CORRECT ANSWERS
CSS stands for - CORRECT ANSWER✅✅✅cascading style sheets
CSS describes: - CORRECT ANSWER✅✅✅how HTML elements are to be displayed
External stylesheets are stored in - CORRECT ANSWER✅✅✅CSS files
what problem did CSS solve - CORRECT ANSWER✅✅✅when tags were introduced to HTML it made
adding fronts and colors to every page a long and expensive process. CSS removed the style formatting
from the HTML page.
CSS selector and declaration - CORRECT ANSWER✅✅✅h1 (selector) {color:blue} (declaration)
selector points to the HTML element you want to style.
declaration block includes a CSS property name and a value.
element selector - CORRECT ANSWER✅✅✅selects elements based on the element name. Ex:
select all <p> elements like this:
p {declaration}
id selector - CORRECT ANSWER✅✅✅uses the id attribute of an HTML element to select a specific
element. Example:
id="para1" would be shown as
#para1 {declaration}
class selector - CORRECT ANSWER✅✅✅selects elements with a specific class attribute. Example:
class="center" would be shown as
.center {declaration}
grouping selectors - CORRECT ANSWER✅✅✅show like so:
, h1, h2, p {declaration}
CSS comments - CORRECT ANSWER✅✅✅starts with /* and ends with */
Three ways to insert CSS - CORRECT ANSWER✅✅✅external style sheet, internal style sheet and
Inline style
External style sheet - CORRECT ANSWER✅✅✅each page must include a reference to the external
style sheet file inside a <link> element inside the <head> section.
style sheet must be saved with a .css extension.
Internal style sheet (where) - CORRECT ANSWER✅✅✅may be used if one single page has a unique
style.
defined within the <style> element, inside the <head> section of a page
Inline styles - CORRECT ANSWER✅✅✅may be used to apply a unique style for a single element.
to use inline styles, add the style attribute to the relevant element.
which element is used for multiple style sheets - CORRECT ANSWER✅✅✅if some properties had
been defined for the same sector in different style sheets, the value from the last read style sheet will be
used.
What style will be used when there is more than one style specified for an HTML element? - CORRECT
ANSWER✅✅✅Inline style then external and internal style sheets then browser default.
Colors in CSS are specified by: - CORRECT ANSWER✅✅✅a valid color name (red), an RGB value (ex.
"rgb(255, 0, 0)"), a HEX value (#ff0000)
CSS background properties: - CORRECT ANSWER✅✅✅color, image, repeat, attachment, position
CSS stands for - CORRECT ANSWER✅✅✅cascading style sheets
CSS describes: - CORRECT ANSWER✅✅✅how HTML elements are to be displayed
External stylesheets are stored in - CORRECT ANSWER✅✅✅CSS files
what problem did CSS solve - CORRECT ANSWER✅✅✅when tags were introduced to HTML it made
adding fronts and colors to every page a long and expensive process. CSS removed the style formatting
from the HTML page.
CSS selector and declaration - CORRECT ANSWER✅✅✅h1 (selector) {color:blue} (declaration)
selector points to the HTML element you want to style.
declaration block includes a CSS property name and a value.
element selector - CORRECT ANSWER✅✅✅selects elements based on the element name. Ex:
select all <p> elements like this:
p {declaration}
id selector - CORRECT ANSWER✅✅✅uses the id attribute of an HTML element to select a specific
element. Example:
id="para1" would be shown as
#para1 {declaration}
class selector - CORRECT ANSWER✅✅✅selects elements with a specific class attribute. Example:
class="center" would be shown as
.center {declaration}
grouping selectors - CORRECT ANSWER✅✅✅show like so:
, h1, h2, p {declaration}
CSS comments - CORRECT ANSWER✅✅✅starts with /* and ends with */
Three ways to insert CSS - CORRECT ANSWER✅✅✅external style sheet, internal style sheet and
Inline style
External style sheet - CORRECT ANSWER✅✅✅each page must include a reference to the external
style sheet file inside a <link> element inside the <head> section.
style sheet must be saved with a .css extension.
Internal style sheet (where) - CORRECT ANSWER✅✅✅may be used if one single page has a unique
style.
defined within the <style> element, inside the <head> section of a page
Inline styles - CORRECT ANSWER✅✅✅may be used to apply a unique style for a single element.
to use inline styles, add the style attribute to the relevant element.
which element is used for multiple style sheets - CORRECT ANSWER✅✅✅if some properties had
been defined for the same sector in different style sheets, the value from the last read style sheet will be
used.
What style will be used when there is more than one style specified for an HTML element? - CORRECT
ANSWER✅✅✅Inline style then external and internal style sheets then browser default.
Colors in CSS are specified by: - CORRECT ANSWER✅✅✅a valid color name (red), an RGB value (ex.
"rgb(255, 0, 0)"), a HEX value (#ff0000)
CSS background properties: - CORRECT ANSWER✅✅✅color, image, repeat, attachment, position