tabIndex not work

Hello! I try set tabIndex

My code pass test, but background color of p does not change.

  p:focus {
    background-color: yellow;
    <h1>Ninja Survey</h1>
      <p tabindex="0">Instructions: Fill in ALL your information then click <b>Submit</b></p>
      <label for="username">Username:</label>
      <input type="text" id="username" name="username"><br>
        <legend>What level ninja are you?</legend>
        <input id="newbie" type="radio" name="levels" value="newbie">
        <label for="newbie">Newbie Kitten</label><br>
        <input id="intermediate" type="radio" name="levels" value="intermediate">
        <label for="intermediate">Developing Student</label><br>
        <input id="master" type="radio" name="levels" value="master">
        <label for="master">9th Life Master</label>
      <legend>Select your favorite weapons:</legend>
      <input id="stars" type="checkbox" name="weapons" value="stars">
      <label for="stars">Throwing Stars</label><br>
      <input id="nunchucks" type="checkbox" name="weapons" value="nunchucks">
      <label for="nunchucks">Nunchucks</label><br>
      <input id="sai" type="checkbox" name="weapons" value="sai">
      <label for="sai">Sai Set</label><br>
      <input id="sword" type="checkbox" name="weapons" value="sword">
      <label for="sword">Sword</label>
      <input type="submit" name="submit" value="Submit">
  <footer>&copy; 2018 Camper Cat</footer>

p {
background-color: yellow;

Your code set background for p as default. I need set background p, if set focus with tabIndex.
If i click on p, show background changed.

Your code is correct tabindex is used to highlight the elements when we tab around to which they are used, try hitting the tab button in your keyboard, it will highlight the paragraph with yellow

tabIndex is not auto focus?

It gets auto focused, when we tab to that element, or when we hover the element it turns the cursor into a line indicating it is focusable

ok, thank you for help