CSS CSS Basics (2014) Basic Selectors Pseudo-Classes

Jason Ford
Jason Ford
2,988 Points

pseudo class

how do I call a pseudo class in the css file?

/* Complete the challenge by writing CSS below */
a  {

<!DOCTYPE html>
    <title>Lake Tahoe</title>
    <link rel="stylesheet" href="page.css">
    <link rel="stylesheet" href="style.css">
      <span>Journey through the Sierra Nevada Mountains</span>
      <h1>Lake Tahoe, California</h1>
      Lake Tahoe is one of the most breathtaking attractions located in California. It's home to a number of ski resorts, summer outdoor recreation, and tourist attractions. Snow and skiing are a significant part of the area's reputation.
    <a href="#">Find out more</a>
      <h2>Check out all the Wildlife</h2>
        As spawning season approaches, the fish acquire a humpback and protuberant jaw. After spawning, they die and their carcasses provide a feast for gatherings of mink, bears, and Bald eagles.
      <a href="#">See the Wildlife</a>
    <h3>From Tents to Resorts</h3>
    Lake Tahoe is full of wonderful places to stay. You have the ability to sleep in the outdoors in a tent, or relax like a king at a five star resort. Here are our top three resorts:
      <li><a href="#">Lake Tahoe Resort Hotel</a></li>
      <li><a href="#">South Lake Tahoe Resorts</a></li>
      <li><a href="#">Tahoe Ski Resort Lodging</a></li>

2 Answers

this defines how the element behaves when the mouse is hovering over it

a:hover {}

this defines how the element looks like when you already clicked the link before

a:visited {}

you can also add stuff in front or after ANY given element (even <html> and <head>)

a:before {}
a:after {}
Callum King
Callum King
Front End Web Development Techdegree Student 4,934 Points

To select unvisited links you'd use the Link Selector like below. You follow your type selector, with a colon, and pseudo-class you want to select.

 a:link {
  color: orange;