Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've a need of span within a form... but it doesn't validate, so I need a better substitute.

So, I've:

[1 text field] [some text] [2 text field] [submit btn]

When I use span for [some text], all is good as it's an inline object everything aligns perfectly. But when I try to use div with display:inline alignment goes crazy.

I don't want to mess with floats. Is there a simple substitute for span inside form?

share|improve this question

closed as off topic by danlefree Jan 29 '12 at 18:00

Questions on Webmasters Stack Exchange are expected to relate to webmastering within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

Why do you need to replace the span element in the first place? And can you setup a jsfiddle.net of your issue? – PeeHaa Jan 29 '12 at 13:57
span is invalid xhtml. – Sandro Dzneladze Jan 29 '12 at 15:38
up vote 1 down vote accepted

is the right tag to put in in a form, if you want to describe what the user should write in the field. It's an inline html element.

share|improve this answer
Nice! thanks... I forgot about it, I was trying to use <legend>, I didin't code long time and I'm forgetting it. – Sandro Dzneladze Jan 29 '12 at 15:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.