Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to I have a <span> within a <li> align to the right side of the <li>

I have a span of the class 'label' from the bootstrap framework. I have this label nested within a <li> and I would like it to align right of the rest of the content in the <li>.

Before I try to modify the css my li's look like this (the orange 'new item' is the label):no css

If I try float: right the label moves to the right, but is at the upper right corner of the <li> as seen here:float right

You can also see the new item label gets pushed to the next line in one situation - I think that is an unrelated problem.

Any tips on how to get my 'new item' span to move to the right of my <li> ? Here is a link to a page I have hosted for demonstration purposes: a

like image 779
Ecnalyr Avatar asked Jan 31 '26 19:01

Ecnalyr


1 Answers

Giving class label margin seems to help:

span.label {
  float: right;
  margin: 10px;
}
like image 85
j08691 Avatar answered Feb 03 '26 07:02

j08691