Fasteners and li css elements

I have a progress bar. It works well, but my concern is style. Some lines are displayed, and I do not know why. In the screenshot below, you can see the lines between the numbers. Any ideas?

Screenshot

My jsfiddle: JSFIDDLE

My code is:

ol.progtrckr {
    margin: 0;
    padding: 0;
    list-style-type: none;
}

ol.progtrckr li {
    display: inline-block;
    text-align: center;
    line-height: 3em;
}

ol.progtrckr[data-progtrckr-steps="4"] li { width: 15%; }

ol.progtrckr li.progtrckr-done {
    color: black;
    padding-right: 12px;
    border-bottom: 4px solid green;
}
ol.progtrckr li.progtrckr-todo {
    color: silver; 
    padding-right: 12px;
    border-bottom: 4px solid silver;
}

ol.progtrckr li:after {
    content: "\00a0\00a0";
}
ol.progtrckr li:before {
    position: relative;
    bottom: -2.5em;
    float: left;
    left: 50%;
    line-height: 1em;
}
ol.progtrckr li.progtrckr-done:before {
    content: "\2713";
    color: white;
    background-color: green;
    height: 1.2em;
    width: 1.2em;
    line-height: 1.2em;
    border: none;
    border-radius: 1.2em;
}
ol.progtrckr li.progtrckr-todo:before {
    content: "\039F";
    color: silver;
    background-color: white;
    font-size: 1.5em;
    bottom: -1.6em;
}
<ol class="progtrckr" data-progtrckr-steps="">
    <a href="#" >
    <li class="progtrckr-done ">1 </li> </a>
    <a href="#">
    <li  class="progtrckr-done">2 </li> </a>
    <a href="#">
    <li class="progtrckr-done">3 </li> </a>
    <a href="#">
    <li class="progtrckr-todo">4 </li> </a>
  
</ol>
Run code
+4
source share
8 answers

Please apply the text design: no for binding under the class "progtrckr", this line will disappear or add below css to your stylesheet -

ol.progtrckr>a {
text-decoration:none;
}
+3
source

"display: inline-block" "ol.progtrckr li", , . "display: inline-block" "float: left". "clearfix" "ol". : ".clerfix" "ol" css:

.clearfix:after {
content: ".";3
display: block;
height: 0;
clear: both;
visibility: hidden;
}
+2

"li" "" , :

<ol class="progtrckr" data-progtrckr-steps="">
    <li class="progtrckr-done"><a href="#">1</a></li>
    <li class="progtrckr-done"><a href="#">2</a></li>
    <li class="progtrckr-done"><a href="#">3</a></li>
    <li class="progtrckr-done"><a href="#">4</a></li>
</ol>
+1

<li>, :

<ol class="progtrckr" data-progtrckr-steps="">
   <li class="progtrckr-done "><a href="#" >1</a></li>
   <li class="progtrckr-done "><a href="#" >2</a></li>
   <li class="progtrckr-done "><a href="#" >3</a></li>
   <li class="progtrckr-done "><a href="#" >4</a></li> 
</ol>

JSFiddle padding:0 :

ol.progtrckr li.progtrckr-done {
    color: black;
    padding-right: 12px;
    border-bottom: 4px solid green;
    padding: 0;
}
0

<a>.

:

a{
  text-decoration: none;
}
0

a:link {
  text-decoration: none;
}

( )

: , , , :

.progtrckr-done a:link,
.progtrckr-done a:hover,
.progtrckr-done a:active,
.progtrckr-done a:visited {
   text-decoration: none;
}
0

​​ : https://jsfiddle.net/aLwgrym8/63/

text-decoration: none :

ol.progtrckr > a {
  text-decoration: none;
}

<li>, , . : https://jsfiddle.net/aLwgrym8/65/

HTML:

<ol class="progtrckr" data-progtrckr-steps="">
    <li class="progtrckr-done "><a href="#" >1</a></li> 
    <li  class="progtrckr-done"><a href="#">2</a></li> 
    <li class="progtrckr-done"><a href="#">3</a></li> 
    <li class="progtrckr-todo"><a href="#">4</a></li>
</ol>

CSS

ol.progtrckr li > a {
  text-decoration: none;
  color: #000;
}
0

, </li> </a> .

<li  class="progtrckr-done">2 </li> </a>

If you delete them, all of the above steps will not be required at all, because the links have nothing to underline.

0
source

Source: https://habr.com/ru/post/1620349/


All Articles