You are here:Home-HTML-CSS-CSS – Cascading Style Sheets

CSS – Cascading Style Sheets

#. Explain what a class selector is and how it’s used:
• A class can be thought of as a grouped collection of CSS attributes applied to HTML elements. This allows you to apply the same styling to multiple HTML elements by placing them in the same CSS class.
• Class methods can be called by inserting a ‘class’ property and name within an HTML element, then calling the class name with a ‘.’ in the CSS doc.
#. What are pseudo classes and what are they used for?
• Pseudo classes are similar to classes, but are not explicitly defined in the markup, and are used to add additional effects to selected HTML elements such as link colors, hover actions, etc.
• :link, :visited, :hover, :active, :first_line are all examples of pseudo classes, used to call a specific action on an element, such as the changing of a link color after it has been visited.
#. Explain the three main ways to apply CSS styles to a Web page:
• Inline: Though this method often goes against best practices, it’s easily done by inserting a ‘style’ attribute inside an HTML element:
o e.g.)

Lorem Ipsum

• Embedded/Internal: Done by defining the head of an HTML document by wrapping characteristics in a