• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

CSS Help

minestrone

More fingers than teeth
Joined
Apr 24, 2008
Messages
17,844
Likes received
990
Thanks received
182
I have a list and I want to alight part of that list to the right hand side. So the money I want to justify up to the right border of the space...

This is what I had..

<ul>
<li>Fred £20</li>
<li>Bob £40</li>
</ul>

So I tried..

<ul>
<li>Fred <span class="text-align:right" > £20</span></li>
<li>Bob <span class="text-align:right" > £40</span></li>
</ul>

But that does not work, anyone know what I am doing wrong?

Thanks
 
You're actually trying to display tabular data so why not use a table?
 
You're actually trying to display tabular data so why not use a table?

Becasue I can't be arsed changing all the nice looking CSS the designer set up for lists to tables. Esp. when its such a minor thing.
 
What Spacecadet Said! It is tabular data.

Have you tried defining a bigger width for the list?
 
On my Mac so cant test any HTML but you could try a div floated right with display:inline?
 
On my Mac so cant test any HTML but you could try a div floated right with display:inline?

Stupid question, but how do macs display web pages then????

In fact how are you reading this?
or is there another web technology that macs use and I don't know about
:freaky: :freaky: :freaky: :freaky: :freaky:
 
Stupid question, but how do macs display web pages then????

What i meant was my Mac here is used for intrawebs and email and doesnt have any form of web development stuff on it and i wouldn't have a clue where the equivalent of Notepad is. I used TextEdit (after Googling for where the feck Notepad was) and:

<ul>
<li>Fred <div style="float:right;display:inline">£20</div></li>
<li>Bob £40</li>
</ul>

Seems to work.
 
Plus if anyone is wondering how the hell to save a file as .htm from TextEdit when it categorically refuses to do so, you need to go Format --> Make Plain Text.

Thats probably why i use Windows to make intraweb pages.
 
doesn't for me! (ie8)

I wrapped a div round it

PHP:
<div style="width:300px">
<ul>
<li>Fred <div style="float:right;display:inline">£20</div></li>
<li>Bob £40</li>
</ul>
</div>

I get this:

PHP:
Fred 
Bob £40       £20



EDIT : Works in firefox though!
 

Advertisers

Back
Top