This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Stylesheets > November 2007 > Can't line up texts
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Can't line up texts
|
|
| ashkaan57@hotmail.com 2007-11-15, 6:17 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">
<asp:DropDownList Width="150px">
</asp:DropDownList>
</span>
<span style="width:150px;">Select Year</span>
<span>
<asp:DropDownList Width="150px">
</asp:DropDownList>
</span>
</div>
<div style="padding:20px 0 20px 0;width:100%;">
<span style="width:150px;">Select Report Type</span>
<span style="padding-right:30px">
<asp:DropDownList Width="150px">
</asp:DropDownList>
</span>
<span style="width:150px;">Select Site</span>
<span>
<asp:DropDownList Width="150px">
</asp:DropDownList>
</span>
</div>
Thanks.
| |
| Bergamot 2007-11-15, 6:17 pm |
| ashkaan57@hotmail.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
| |
| ashkaan57@hotmail.com 2007-11-16, 6:21 pm |
| On Nov 15, 5:30 pm, Bergamot <berga...@visi.com> wrote:
> ashkaa...@hotmail.com wrote:
>
>
>
> 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.
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|