[SOLVED] a span alignment

This is a discussion on "[SOLVED] a span alignment" within the Web Page Design section. This forum, and the thread "[SOLVED] a span alignment are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Dec 11th, 2007, 19:01
Junior Member
Join Date: Oct 2007
Location: Holland
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] a span alignment

hey

I'd like to get an unordered list of the form:


Code: Select all
 
* item_1                 3
* item_2                23
* item_3                 6
* item_4               234
My code is something of the sort:

Code: Select all
<ul>
   <li>
      <span style="width=200px">item_1</span>
      <span>3</span>
   </li>
   ...........
</ul>
instead of the style="....." I have css classes.
However, the layout I get is:

* item_1 3
* item_2 26
* item_3 6
* item_4 234

Obviously, it doesn't recognize the span width.
Do you have any idea why it could be so????
... and how I could fix it.

thanks,
P
Reply With Quote

  #2 (permalink)  
Old Dec 11th, 2007, 19:04
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: a span alignment

Hmmm ... set a width for the li, then float the first span left and float the other span right.

That might work.
Reply With Quote
  #3 (permalink)  
Old Dec 11th, 2007, 19:27
Junior Member
Join Date: Oct 2007
Location: Holland
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Re: a span alignment

hm, then the numbers go to the right, but fall on the next line (below)
I'm afraid that some of the style attributes may be inherited from higher-order tags and therefore I get this strange result.

Do I have to add anything else except for the width to overcome overriding of a (important) attribute in my case?

thanks!
Reply With Quote
  #4 (permalink)  
Old Dec 11th, 2007, 19:51
SuperMember

SuperMember
Join Date: Jun 2007
Location: uk
Posts: 459
Thanks: 0
Thanked 0 Times in 0 Posts
Re: a span alignment

not sure if this is what you are after but this seems to work.

HTML: Select all
<ul>
   <li>
      item_1<span style="margin-left:200px;">
      3</span>
   </li>
   ...........
</ul>
Reply With Quote
  #5 (permalink)  
Old Dec 12th, 2007, 02:11
Highly Reputable Member
Join Date: Sep 2007
Age: 15
Posts: 717
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: a span alignment

The above ^ is maybe not the best way, but the idea is good. If you put the number into a span like dab42pat did, and use CSS to push that span to the right, you should get the desired effect.
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
Reply With Quote
  #6 (permalink)  
Old Dec 12th, 2007, 08:04
SuperMember

SuperMember
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: a span alignment

Quote:
Originally Posted by pesho318i View Post
I'd like to get an unordered list of the form:


Code: Select all
 
* item_1                 3
* item_2                23
* item_3                 6
* item_4               234
Um...

That's not an unordered list; it's an unordered table.

Why not use a <table>?
Reply With Quote
  #7 (permalink)  
Old Dec 12th, 2007, 08:24
Junior Member
Join Date: Oct 2007
Location: Holland
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Re: a span alignment

yup, in the end I fixed it using table...

thanks
Reply With Quote
  #8 (permalink)  
Old Dec 12th, 2007, 08:36
welshstew's Avatar
Lead Administrator

SuperMember
Join Date: May 2007
Location: inside the outside
Posts: 1,378
Blog Entries: 13
Thanks: 1
Thanked 15 Times in 13 Posts
Re: a span alignment

thread marked as solved
__________________
WelshStew
Lead Administrator

tierney rides tboard - uk site | xtreme wales - extreme clothing
If you think I've helped, click the "Thanks"
webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can <span></span> tags have position relative? Oak Web Page Design 13 Mar 9th, 2008 17:04
[SOLVED] CSS Alignment Issue AaronSmith Web Page Design 5 Jan 23rd, 2008 14:21
[SOLVED] Annoying.. alignment. PicoDeath Web Page Design 9 Dec 12th, 2007 11:15
[SOLVED] Cross browser alignment Mulith Starting Out 12 Nov 14th, 2007 04:07
<SPAN> help Access JavaScript Forum 2 Nov 3rd, 2007 18:13


All times are GMT. The time now is 03:53.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43