Aligning text on a specific character

前端 未结 7 543
一生所求
一生所求 2020-12-05 19:19

I have this list of words i want to align on the center, every list item consists of two words divided by a \'-\'(hyphen). Is there an easy way i can align spot on the hyphe

7条回答
  •  遥遥无期
    2020-12-05 20:03

    as I suggested in other answer , this could use the

    tags if semantics matters :

    lopen
    ik loop
    zij lopen
    klimmen
    ik klim
    geven
    ik geef
    schreeuwen
    ik schreeuw
    blozen
    ik bloos
    je bloos
    hij bloss

    with css

    .progress-ww {
      text-align:center;
      width:260px;
      /* margin : auto ; maybe ? */
    
    }
    dt , dd {
      width:100px;
      display:inline-block;
      vertical-align:top;
      margin:0;
      padding:0 5px 0 0;
    }
    dt {text-align:right;}
    dd {text-align:left;}
    dt:after {content:' -';}
    

    DEMO

提交回复
热议问题