Chapter 3 Quiz Flashcards
To further the effort to let HTML be used to define the structure of a document only, and not appearance, what was introduced?
Cascading style sheets
What is a cascading style sheet?
Code that specifies formatting based styles
What are three ways to apply CSS?
inline style, internal style, and external style
What is the simplest way to attach a tag?
Using inline styles
What is the correct syntax for displaying the level 1 heading “I’m so blue” in blue italics using inline style formatting?
h1 style=”color: blue; font-style: italic;” I’m so blue /h1
Where are inline styles defined?
Within the HTML tag
An inline style is created by adding what attribute to an HTML tag?
Style attribute
A CSS property is separated from its value by what?
Colon and a space
Multiple CSS property-value pairs are separated from each other by what?
Semi-colon and a space
What does the span tag do?
It allows us to set an inline style for all the content within the tag.
What is the drawback of inline styles?
They need to be created within each tag, one-time use, difficult to maintain, harder to read, need to be created everywhere and every time it is needed.
How are internal styles different from inline styles?
Internal styles are defined within the head section of the document and not in each individual tag. Internal styles affect the entire page while inline style only affects the tag it is in.
Internal styles are defined within what specific tag in the head section of an HTML document?
style
If internal styles aren’t defined within an HTML tag, how does the browser know where to apply the style?
By the selector.
Within the style tag, what is the type attribute set to in all cascading style sheets?
text/css
What are selectors?
Pieces of code that determine what sections of a page are affected by a specific style.
After the selector is identified, the property-value pairs are defined and enclosed with what?
Curly brackets
What types of selectors are available?
Element name, element and attributes, classes, Ids, and pseudo-classes.
What is the benefit of internal styles?
They can be applied through the entire web page, easier to use.
What is an element selector?
An element name used to specify style for all instances of that element.
Can element selectors be grouped, or must they always be defined individually?
They can be grouped by separating them with a comma h1, h2, h3
What does a contextual selector do?
Allows you to specify style under certain conditions. (p a {font-family: Verdana}
Regarding selectors, what is a class?
A class is a way to create style that is not tied to a specific tag element.
How would you identify a class?
Dot before the name