HighDots Forums  

Can't line up texts

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Can't line up texts in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ashkaan57@hotmail.com
 
Posts: n/a

Default Can't line up texts - 11-15-2007 , 04:01 PM






Hi,
I am having problem lining up two labels on two lines below each
other. I have:
text --- dropdown --- text --- dropdown
text --- dropdown --- text --- dropdowns

and even though I specified same width for both texts, within a span,
the dropdowns don't line up.

<div style="width:100%">
<span style="width:150px;">Select Month</span>
<span style="padding-right:30px">
<aspropDownList Width="150px">
</aspropDownList>
</span>
<span style="width:150px;">Select Year</span>
<span>
<aspropDownList Width="150px">
</aspropDownList>
</span>
</div>

<div style="padding:20px 0 20px 0;width:100%;">
<span style="width:150px;">Select Report Type</span>
<span style="padding-right:30px">
<aspropDownList Width="150px">
</aspropDownList>
</span>
<span style="width:150px;">Select Site</span>
<span>
<aspropDownList Width="150px">
</aspropDownList>
</span>
</div>

Thanks.

Reply With Quote
  #2  
Old   
Bergamot
 
Posts: n/a

Default Re: Can't line up texts - 11-15-2007 , 04:30 PM






ashkaan57 (AT) hotmail (DOT) com wrote:
Quote:
and even though I specified same width for both texts, within a span,
the dropdowns don't line up.

span style="width:150px;">Select Month</span
http://www.w3.org/TR/CSS21/visudet.html#propdef-width
"Applies to: all elements but non-replaced inline elements, table
rows, and row groups"

Span is a non-replaced inline element, so width doesn't apply.

BTW, you should be using <label> instead of <span> for those form
labels. That's what it's for. And you can probably get all your other
form styling questions answered yourself:
http://www.google.com/search?q=style+forms+with+css

--
Berg


Reply With Quote
  #3  
Old   
ashkaan57@hotmail.com
 
Posts: n/a

Default Re: Can't line up texts - 11-16-2007 , 09:20 AM



On Nov 15, 5:30 pm, Bergamot <berga... (AT) visi (DOT) com> wrote:
Quote:
ashkaa... (AT) hotmail (DOT) com wrote:

and even though I specified same width for both texts, within a span,
the dropdowns don't line up.

span style="width:150px;">Select Month</span

http://www.w3.org/TR/CSS21/visudet.html#propdef-width
"Applies to: all elements but non-replaced inline elements, table
rows, and row groups"

Span is a non-replaced inline element, so width doesn't apply.

BTW, you should be using <label> instead of <span> for those form
labels. That's what it's for. And you can probably get all your other
form styling questions answered yourself:http://www.google.com/search?q=style+forms+with+css

--
Berg
Thanks. I learned something new today. I used lables and it is fine.


Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.