0

The problem I am having is hard coding the style element focus in a HTML tag. On the css page it looks something like this:

span.select.focus {
    background:rgba(189, 189, 189);
    border-right:solid 8px rgba(170, 194, 31, 0) !important;
}

Where is I can hard style the element without the focus

<span data-prefix="Shopping cart: " class="select profile" id="wordsPerQuiz" style="background-color: rgb (189,189,189)"> </span>

Here is my attempt.

  <span data-prefix="Shopping cart: " class="select profile" id="wordsPerQuiz" style="background-color: rgb (189,189,189)" focus="background-color: rgb (189,189,189)"> </span>
dsharew
  • 10,377
  • 6
  • 49
  • 75
Chris Rathjen
  • 11
  • 2
  • 2
  • 9

1 Answers1

2

Pseudoclass focus needs to : before, not .:

span.select:focus {
    background:rgb(189, 189, 189);
    border-right:solid 8px rgba(170, 194, 31, 0) !important;
}

Element with span.select.focus selector is <span class="select focus"> in HTML.

pavel
  • 26,538
  • 10
  • 45
  • 61