473,405 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Can't line up texts

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.
Nov 15 '07 #1
2 1853
as*******@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 <labelinstead of <spanfor 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
Nov 15 '07 #2
On Nov 15, 5:30 pm, Bergamot <berga...@visi.comwrote:
ashkaa...@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 <labelinstead of <spanfor 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.
Nov 16 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: tramoman | last post by:
Hi! I would like to make an algorith that recognise a Forced line break in HTML or a normal text. For instance, I would like to store in one array different lines of a string. Here my attempt:...
14
by: Haines Brown | last post by:
In another thread, the following comment was made: > I tried the following with Mozilla Firebird (using Gecko/20030712). > > Isofarro wrote: > > http://www.pga.com/openchampionship/ > > I...
5
by: Dario de Judicibus | last post by:
Let's suppose I have the following structure <div id="container"> <div id="above60"> Questo testo va sopra la riga. </div> <div id="under60"> Questo testo va sotto la riga. </div> </div>
2
by: Chance Ginger | last post by:
I am rather new at Python so I want to get it right. What I am doing is writing a rather large application with plenty of places that strings will be used. Most of the strings involve statements of...
7
by: mattrapoport | last post by:
I have a page with a div on it. The div displays a user comment. When the user logs into this page, their current comment is pulled from a db and displayed in the div. The user can edit the...
6
by: Markus Ernst | last post by:
Hi Searching for a possibility to display some text with preserved white space and line breaks, but with long lines being wrapped, I found this CSS declaration, which I found helpful: pre {...
2
by: bobbymusic | last post by:
Hey all, my problem is when I start to compare two texts with different lenght. The point is that the texts are loaded in two RTB and I don't know how to compare them. I found that I have to parse...
0
by: anupam roy | last post by:
Hi, I have created my own XML text editor and using XmlReader to read the xml files I have opened one xml file for editing in the text box editor( i have . Now before saving the file, i want to...
9
by: SuperNova | last post by:
Hello! I need to mark similar phrases in two different texts, for example to use <btag. Example: text 1: Google Chrome is a browser that combines a minimal design with sophisticated...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.