Step Progress Bar Icons










0















I'm trying to set up a little step progress bar that only has an icon for the current step. I've gotten so far as to have a default icon of sorts, but can't figure out how to clear it for non-active steps.



In the code below, I tried playing with pseudo classes but that didn't seem to work. I'm wondering if anyone can point me in the right direction. Thanks!



 .step-indicator-container 
width: 600px;
margin: 100px auto;


.step-indicator li
list-style-type: none;
width: 33.33%;
float: left;
font-size: 12px;
position: relative;
text-align: center;
text-transform: uppercase;
color: #7d7d7d;


.step-indicator li:before
font-family: "FontAwesome";
content: "f276";
width: 30px;
height: 30px;
line-height: 30px;
border: 2px solid #7d7d7d;
display: block;
text-align: center;
margin: 0 auto 10px auto;
border-radius: 50%;
background-color: white;


.step-indicator li:after
width: 100%;
height: 2px;
content: "";
position: absolute;
background-color: #7d7d7d;
top: 15px;
left: -50%;
z-index: -1;


.step-indicator li:not(.active):nth-of-type(2) > *::before
content: none;


.step-indicator li:first-child:after
content: none;


.step-indicator li.active
color: #0052e7;


.step-indicator li.active:before
border-color: #0052e7;


.step-indicator li.active+li:after
background-color: #0052e7;










share|improve this question






















  • Can you provide your HTML? Edit your question and add a code snippet so we can see it in action.

    – chazsolo
    Nov 11 '18 at 2:34















0















I'm trying to set up a little step progress bar that only has an icon for the current step. I've gotten so far as to have a default icon of sorts, but can't figure out how to clear it for non-active steps.



In the code below, I tried playing with pseudo classes but that didn't seem to work. I'm wondering if anyone can point me in the right direction. Thanks!



 .step-indicator-container 
width: 600px;
margin: 100px auto;


.step-indicator li
list-style-type: none;
width: 33.33%;
float: left;
font-size: 12px;
position: relative;
text-align: center;
text-transform: uppercase;
color: #7d7d7d;


.step-indicator li:before
font-family: "FontAwesome";
content: "f276";
width: 30px;
height: 30px;
line-height: 30px;
border: 2px solid #7d7d7d;
display: block;
text-align: center;
margin: 0 auto 10px auto;
border-radius: 50%;
background-color: white;


.step-indicator li:after
width: 100%;
height: 2px;
content: "";
position: absolute;
background-color: #7d7d7d;
top: 15px;
left: -50%;
z-index: -1;


.step-indicator li:not(.active):nth-of-type(2) > *::before
content: none;


.step-indicator li:first-child:after
content: none;


.step-indicator li.active
color: #0052e7;


.step-indicator li.active:before
border-color: #0052e7;


.step-indicator li.active+li:after
background-color: #0052e7;










share|improve this question






















  • Can you provide your HTML? Edit your question and add a code snippet so we can see it in action.

    – chazsolo
    Nov 11 '18 at 2:34













0












0








0








I'm trying to set up a little step progress bar that only has an icon for the current step. I've gotten so far as to have a default icon of sorts, but can't figure out how to clear it for non-active steps.



In the code below, I tried playing with pseudo classes but that didn't seem to work. I'm wondering if anyone can point me in the right direction. Thanks!



 .step-indicator-container 
width: 600px;
margin: 100px auto;


.step-indicator li
list-style-type: none;
width: 33.33%;
float: left;
font-size: 12px;
position: relative;
text-align: center;
text-transform: uppercase;
color: #7d7d7d;


.step-indicator li:before
font-family: "FontAwesome";
content: "f276";
width: 30px;
height: 30px;
line-height: 30px;
border: 2px solid #7d7d7d;
display: block;
text-align: center;
margin: 0 auto 10px auto;
border-radius: 50%;
background-color: white;


.step-indicator li:after
width: 100%;
height: 2px;
content: "";
position: absolute;
background-color: #7d7d7d;
top: 15px;
left: -50%;
z-index: -1;


.step-indicator li:not(.active):nth-of-type(2) > *::before
content: none;


.step-indicator li:first-child:after
content: none;


.step-indicator li.active
color: #0052e7;


.step-indicator li.active:before
border-color: #0052e7;


.step-indicator li.active+li:after
background-color: #0052e7;










share|improve this question














I'm trying to set up a little step progress bar that only has an icon for the current step. I've gotten so far as to have a default icon of sorts, but can't figure out how to clear it for non-active steps.



In the code below, I tried playing with pseudo classes but that didn't seem to work. I'm wondering if anyone can point me in the right direction. Thanks!



 .step-indicator-container 
width: 600px;
margin: 100px auto;


.step-indicator li
list-style-type: none;
width: 33.33%;
float: left;
font-size: 12px;
position: relative;
text-align: center;
text-transform: uppercase;
color: #7d7d7d;


.step-indicator li:before
font-family: "FontAwesome";
content: "f276";
width: 30px;
height: 30px;
line-height: 30px;
border: 2px solid #7d7d7d;
display: block;
text-align: center;
margin: 0 auto 10px auto;
border-radius: 50%;
background-color: white;


.step-indicator li:after
width: 100%;
height: 2px;
content: "";
position: absolute;
background-color: #7d7d7d;
top: 15px;
left: -50%;
z-index: -1;


.step-indicator li:not(.active):nth-of-type(2) > *::before
content: none;


.step-indicator li:first-child:after
content: none;


.step-indicator li.active
color: #0052e7;


.step-indicator li.active:before
border-color: #0052e7;


.step-indicator li.active+li:after
background-color: #0052e7;







css






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 11 '18 at 2:28









DD1229DD1229

317




317












  • Can you provide your HTML? Edit your question and add a code snippet so we can see it in action.

    – chazsolo
    Nov 11 '18 at 2:34

















  • Can you provide your HTML? Edit your question and add a code snippet so we can see it in action.

    – chazsolo
    Nov 11 '18 at 2:34
















Can you provide your HTML? Edit your question and add a code snippet so we can see it in action.

– chazsolo
Nov 11 '18 at 2:34





Can you provide your HTML? Edit your question and add a code snippet so we can see it in action.

– chazsolo
Nov 11 '18 at 2:34












1 Answer
1






active

oldest

votes


















1














For this answer, I am assuming the following is your HTML structure:



<div class="step-indicator-container">
<ul class="step-indicator">
<li></li>
<li class="active"></li>
<li></li>
</ul>
</div>


The issue is with the following declaration:



.step-indicator li:not(.active):nth-of-type(2) > *::before 
content: none;



This is targeting the ::before of a descendant of the li tag. However, you actually put your symbol on the ::before of the li tag itself, not a descendant. Therefore, that's what you need to be targeting. Furthermore, content: none eliminates the ::before, so you actually want content: "". Here's what I think you actually want:



.step-indicator li:not(.active)::before 
content: "";



And here's the full code snippet (note I replaced your symbol with the $):






.step-indicator-container 
width: 600px;
margin: 100px auto;


.step-indicator li
list-style-type: none;
width: 33.33%;
float: left;
font-size: 12px;
position: relative;
text-align: center;
text-transform: uppercase;
color: #7d7d7d;


.step-indicator li:before
content: "$";
width: 30px;
height: 30px;
line-height: 30px;
border: 2px solid #7d7d7d;
display: block;
text-align: center;
margin: 0 auto 10px auto;
border-radius: 50%;
background-color: white;


.step-indicator li:after
width: 100%;
height: 2px;
content: "";
position: absolute;
background-color: #7d7d7d;
top: 15px;
left: -50%;
z-index: -1;


.step-indicator li:not(.active)::before
content: "";


.step-indicator li:first-child:after
content: none;


.step-indicator li.active
color: #0052e7;


.step-indicator li.active:before
border-color: #0052e7;


.step-indicator li.active+li:after
background-color: #0052e7;

<div class="step-indicator-container">
<ul class="step-indicator">
<li></li>
<li class="active"></li>
<li></li>
</ul>
</div>








share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245334%2fstep-progress-bar-icons%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    For this answer, I am assuming the following is your HTML structure:



    <div class="step-indicator-container">
    <ul class="step-indicator">
    <li></li>
    <li class="active"></li>
    <li></li>
    </ul>
    </div>


    The issue is with the following declaration:



    .step-indicator li:not(.active):nth-of-type(2) > *::before 
    content: none;



    This is targeting the ::before of a descendant of the li tag. However, you actually put your symbol on the ::before of the li tag itself, not a descendant. Therefore, that's what you need to be targeting. Furthermore, content: none eliminates the ::before, so you actually want content: "". Here's what I think you actually want:



    .step-indicator li:not(.active)::before 
    content: "";



    And here's the full code snippet (note I replaced your symbol with the $):






    .step-indicator-container 
    width: 600px;
    margin: 100px auto;


    .step-indicator li
    list-style-type: none;
    width: 33.33%;
    float: left;
    font-size: 12px;
    position: relative;
    text-align: center;
    text-transform: uppercase;
    color: #7d7d7d;


    .step-indicator li:before
    content: "$";
    width: 30px;
    height: 30px;
    line-height: 30px;
    border: 2px solid #7d7d7d;
    display: block;
    text-align: center;
    margin: 0 auto 10px auto;
    border-radius: 50%;
    background-color: white;


    .step-indicator li:after
    width: 100%;
    height: 2px;
    content: "";
    position: absolute;
    background-color: #7d7d7d;
    top: 15px;
    left: -50%;
    z-index: -1;


    .step-indicator li:not(.active)::before
    content: "";


    .step-indicator li:first-child:after
    content: none;


    .step-indicator li.active
    color: #0052e7;


    .step-indicator li.active:before
    border-color: #0052e7;


    .step-indicator li.active+li:after
    background-color: #0052e7;

    <div class="step-indicator-container">
    <ul class="step-indicator">
    <li></li>
    <li class="active"></li>
    <li></li>
    </ul>
    </div>








    share|improve this answer



























      1














      For this answer, I am assuming the following is your HTML structure:



      <div class="step-indicator-container">
      <ul class="step-indicator">
      <li></li>
      <li class="active"></li>
      <li></li>
      </ul>
      </div>


      The issue is with the following declaration:



      .step-indicator li:not(.active):nth-of-type(2) > *::before 
      content: none;



      This is targeting the ::before of a descendant of the li tag. However, you actually put your symbol on the ::before of the li tag itself, not a descendant. Therefore, that's what you need to be targeting. Furthermore, content: none eliminates the ::before, so you actually want content: "". Here's what I think you actually want:



      .step-indicator li:not(.active)::before 
      content: "";



      And here's the full code snippet (note I replaced your symbol with the $):






      .step-indicator-container 
      width: 600px;
      margin: 100px auto;


      .step-indicator li
      list-style-type: none;
      width: 33.33%;
      float: left;
      font-size: 12px;
      position: relative;
      text-align: center;
      text-transform: uppercase;
      color: #7d7d7d;


      .step-indicator li:before
      content: "$";
      width: 30px;
      height: 30px;
      line-height: 30px;
      border: 2px solid #7d7d7d;
      display: block;
      text-align: center;
      margin: 0 auto 10px auto;
      border-radius: 50%;
      background-color: white;


      .step-indicator li:after
      width: 100%;
      height: 2px;
      content: "";
      position: absolute;
      background-color: #7d7d7d;
      top: 15px;
      left: -50%;
      z-index: -1;


      .step-indicator li:not(.active)::before
      content: "";


      .step-indicator li:first-child:after
      content: none;


      .step-indicator li.active
      color: #0052e7;


      .step-indicator li.active:before
      border-color: #0052e7;


      .step-indicator li.active+li:after
      background-color: #0052e7;

      <div class="step-indicator-container">
      <ul class="step-indicator">
      <li></li>
      <li class="active"></li>
      <li></li>
      </ul>
      </div>








      share|improve this answer

























        1












        1








        1







        For this answer, I am assuming the following is your HTML structure:



        <div class="step-indicator-container">
        <ul class="step-indicator">
        <li></li>
        <li class="active"></li>
        <li></li>
        </ul>
        </div>


        The issue is with the following declaration:



        .step-indicator li:not(.active):nth-of-type(2) > *::before 
        content: none;



        This is targeting the ::before of a descendant of the li tag. However, you actually put your symbol on the ::before of the li tag itself, not a descendant. Therefore, that's what you need to be targeting. Furthermore, content: none eliminates the ::before, so you actually want content: "". Here's what I think you actually want:



        .step-indicator li:not(.active)::before 
        content: "";



        And here's the full code snippet (note I replaced your symbol with the $):






        .step-indicator-container 
        width: 600px;
        margin: 100px auto;


        .step-indicator li
        list-style-type: none;
        width: 33.33%;
        float: left;
        font-size: 12px;
        position: relative;
        text-align: center;
        text-transform: uppercase;
        color: #7d7d7d;


        .step-indicator li:before
        content: "$";
        width: 30px;
        height: 30px;
        line-height: 30px;
        border: 2px solid #7d7d7d;
        display: block;
        text-align: center;
        margin: 0 auto 10px auto;
        border-radius: 50%;
        background-color: white;


        .step-indicator li:after
        width: 100%;
        height: 2px;
        content: "";
        position: absolute;
        background-color: #7d7d7d;
        top: 15px;
        left: -50%;
        z-index: -1;


        .step-indicator li:not(.active)::before
        content: "";


        .step-indicator li:first-child:after
        content: none;


        .step-indicator li.active
        color: #0052e7;


        .step-indicator li.active:before
        border-color: #0052e7;


        .step-indicator li.active+li:after
        background-color: #0052e7;

        <div class="step-indicator-container">
        <ul class="step-indicator">
        <li></li>
        <li class="active"></li>
        <li></li>
        </ul>
        </div>








        share|improve this answer













        For this answer, I am assuming the following is your HTML structure:



        <div class="step-indicator-container">
        <ul class="step-indicator">
        <li></li>
        <li class="active"></li>
        <li></li>
        </ul>
        </div>


        The issue is with the following declaration:



        .step-indicator li:not(.active):nth-of-type(2) > *::before 
        content: none;



        This is targeting the ::before of a descendant of the li tag. However, you actually put your symbol on the ::before of the li tag itself, not a descendant. Therefore, that's what you need to be targeting. Furthermore, content: none eliminates the ::before, so you actually want content: "". Here's what I think you actually want:



        .step-indicator li:not(.active)::before 
        content: "";



        And here's the full code snippet (note I replaced your symbol with the $):






        .step-indicator-container 
        width: 600px;
        margin: 100px auto;


        .step-indicator li
        list-style-type: none;
        width: 33.33%;
        float: left;
        font-size: 12px;
        position: relative;
        text-align: center;
        text-transform: uppercase;
        color: #7d7d7d;


        .step-indicator li:before
        content: "$";
        width: 30px;
        height: 30px;
        line-height: 30px;
        border: 2px solid #7d7d7d;
        display: block;
        text-align: center;
        margin: 0 auto 10px auto;
        border-radius: 50%;
        background-color: white;


        .step-indicator li:after
        width: 100%;
        height: 2px;
        content: "";
        position: absolute;
        background-color: #7d7d7d;
        top: 15px;
        left: -50%;
        z-index: -1;


        .step-indicator li:not(.active)::before
        content: "";


        .step-indicator li:first-child:after
        content: none;


        .step-indicator li.active
        color: #0052e7;


        .step-indicator li.active:before
        border-color: #0052e7;


        .step-indicator li.active+li:after
        background-color: #0052e7;

        <div class="step-indicator-container">
        <ul class="step-indicator">
        <li></li>
        <li class="active"></li>
        <li></li>
        </ul>
        </div>








        .step-indicator-container 
        width: 600px;
        margin: 100px auto;


        .step-indicator li
        list-style-type: none;
        width: 33.33%;
        float: left;
        font-size: 12px;
        position: relative;
        text-align: center;
        text-transform: uppercase;
        color: #7d7d7d;


        .step-indicator li:before
        content: "$";
        width: 30px;
        height: 30px;
        line-height: 30px;
        border: 2px solid #7d7d7d;
        display: block;
        text-align: center;
        margin: 0 auto 10px auto;
        border-radius: 50%;
        background-color: white;


        .step-indicator li:after
        width: 100%;
        height: 2px;
        content: "";
        position: absolute;
        background-color: #7d7d7d;
        top: 15px;
        left: -50%;
        z-index: -1;


        .step-indicator li:not(.active)::before
        content: "";


        .step-indicator li:first-child:after
        content: none;


        .step-indicator li.active
        color: #0052e7;


        .step-indicator li.active:before
        border-color: #0052e7;


        .step-indicator li.active+li:after
        background-color: #0052e7;

        <div class="step-indicator-container">
        <ul class="step-indicator">
        <li></li>
        <li class="active"></li>
        <li></li>
        </ul>
        </div>





        .step-indicator-container 
        width: 600px;
        margin: 100px auto;


        .step-indicator li
        list-style-type: none;
        width: 33.33%;
        float: left;
        font-size: 12px;
        position: relative;
        text-align: center;
        text-transform: uppercase;
        color: #7d7d7d;


        .step-indicator li:before
        content: "$";
        width: 30px;
        height: 30px;
        line-height: 30px;
        border: 2px solid #7d7d7d;
        display: block;
        text-align: center;
        margin: 0 auto 10px auto;
        border-radius: 50%;
        background-color: white;


        .step-indicator li:after
        width: 100%;
        height: 2px;
        content: "";
        position: absolute;
        background-color: #7d7d7d;
        top: 15px;
        left: -50%;
        z-index: -1;


        .step-indicator li:not(.active)::before
        content: "";


        .step-indicator li:first-child:after
        content: none;


        .step-indicator li.active
        color: #0052e7;


        .step-indicator li.active:before
        border-color: #0052e7;


        .step-indicator li.active+li:after
        background-color: #0052e7;

        <div class="step-indicator-container">
        <ul class="step-indicator">
        <li></li>
        <li class="active"></li>
        <li></li>
        </ul>
        </div>






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 11 '18 at 7:09









        AuroratideAuroratide

        62128




        62128



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245334%2fstep-progress-bar-icons%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

            Edmonton

            Crossroads (UK TV series)