0

What I want to achieve is the following:

| foo                      bar  baz  bam |

i.e. having the first element of a list floating to left and consecutive elements in that list aligned to the right. I've attached of snippet of my attempt, which doesn't quite yield what I need.

ul li {
  display: inline;
  float: right;
  margin-right: 3vw;
  margin-bottom: 5vh;
}
<ul>
  <li>foo</li>  
  <li>bar</li>  
  <li>baz</li>  
  <li>bam</li>  
</ul>
Christopher Moore
  • 12,922
  • 9
  • 35
  • 46
alexjrlewis
  • 2,717
  • 3
  • 24
  • 58

1 Answers1

0
<ul>
 <li><span style="padding-right: 10px;">|</span>foo</li>  
 <li>bam<span style="padding-left: 10px;">|</span></li>
 <li>baz</li>
 <li>bar</li>
</ul>
ul li {
  display: inline;
  float: right;
  margin-right: 3vw;
  margin-bottom: 5vh;
}
ul li:first-child {
  float: left;
}
user3337667
  • 151
  • 1
  • 10