473,503 Members | 2,135 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

span with width or inline div

I have something like this:

<span style="width:12ex; text-align: right">field label</span><input
type="text" ...>

(I suppose it may be better to do that with label. I'm not really sure
what that tag is about.)

that emulates this ever popular table layout (but is foldable):

<tr><td align="right">field label</td><td><input type="text"
....></td></tr>

What I don't remember is whether giving spans widths is legal or not?
This could be done with inline divs, but I seem to recall that either
isn't legal or Opera is not fond of them. Which is it?

Jeff
Jul 20 '05 #1
1 5257
Jeff Thies wrote:

<span style="width:12ex; text-align: right">field label</span><input
type="text" ...>

(I suppose it may be better to do that with label.
Yes, it would.
I'm not really sure what that tag is about.)
< http://www.w3.org/TR/html401/interact/forms.html#h-17.9 >
that emulates this ever popular table layout (but is foldable):

<tr><td align="right">field label</td><td><input type="text"
...></td></tr>

What I don't remember is whether giving spans widths is legal or not?
No. Inline elements cannot have a width set.
This could be done with inline divs, but I seem to recall that either
isn't legal or Opera is not fond of them. Which is it?


I don't know about Opera. But declaring a div (or any block level
element) as inline would, I think, then preclude setting a width.

My advice:
use label, since it assigns semantic meaning to the input labels.
Float them left, essentially making them block level. Declare a
width. Note that, in NS6/Mac (and possibly NS6/Win), floating a label
element makes it disappear entirely! IIRC, putting the actual text in
a span element, and floating that fixes it. I can't find the post at
the moment. I'll continue looking, and post a link if I find it.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #2

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

Similar topics

6
18222
by: bugbear | last post by:
I've spent the last 2 days reading in waaay too much detail the specs for CSS and HTML. I am attempting something very simple. I wish to wrap an image and caption in a span, so that the text can...
9
7002
by: developer | last post by:
Does anyone know what is the way IE treats span tags(<span>) and table tags(<tr>, <td>)? Should the <span> tag be encolsed in tds and trs if it placed with other elements that are in a table? Can...
10
28767
by: lac | last post by:
Hello all, I am trying to make horizontal bars of different lengths. I tought either SPAN or DIV would work but it only works for IE. I have a small example at: http://sedivy.com/test.htm Let...
5
3234
by: ste.paoletti | last post by:
I have a problem with css I have a this xhtml code: <span> <span> <span/> <input type="radio"/> .... <span/> <input type="button" onclick ="var s=document.createElement('span');...
3
1671
by: reproots | last post by:
hi there, i am having trouble with a span command and would like to know if someone can help me, or point me in the correct direction. basically, i want a little textbox to pop up when a mouse...
5
5478
by: David Housman | last post by:
Hello, I'm trying to implement a navigation bar with a ul in css. The code is a template, but i'm customizing. I can handle just text in each block, but i want the first block to have an image...
5
20018
by: Summercool | last post by:
wow... i didn't know that, for <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http:// www.w3.org/TR/html4/loose.dtd"> <span style="width: 100px; background:...
5
3519
by: Brent | last post by:
Take this small HTML fragment: span.theClass{float:left;width:100px;cursor:pointer;cursor:hand;} ------------------------ <div> <span id="1" class="theClass">&nbsp;<span> <span id="2"...
6
4462
by: liketofindoutwhy | last post by:
There is a link that encloses a span (or a div), but the link won't work in IE 7 (clicking on video image works, but not on the play button), while it works well in Firefox 2 and 3, and Safari 3....
0
7205
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
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7287
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
5596
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4689
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
401
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.