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
  • 15,626
  • 10
  • 42
  • 52
ajrlewis
  • 2,968
  • 3
  • 33
  • 67

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
  • 161
  • 1
  • 10