On 20 Okt, 01:33, Robert K S <[EMAIL PROTECTED]> wrote:
> I am having trouble validating a form that I have in a top navigation
> bar of a web site written in XHTML.
>
> The form is a simple search form with just a single text input and a
> single submit button.
>
> I want the form to be formatted by CSS, so I have it enclosed in a
> span with an ID.  The validator doesn't like this, because form is a
> block-level element and span is an inline element,

You can enclose the form element in a div element or set the id on the
form element directly, and display those elements as inline elements.

#navbarsearch, #navbarsearch form { display: inline }

> and block-level
> elements cannot be enclosed in inline elements.
>
> Fine, say I: I'll reverse the order of the form and span tags, so that
> now the span that bestows the form its CSS formatting is inside the
> form.  But the validator chokes on this, too, and I'm not sure why.

That should work. What is the error message?

> It seems to me like the real problem here is that form is a block-
> level element without any good reason.

Forms might use tabular layout (allowed in html). It might also have
tabular data that needs updating. IMO, that means that forms should be
able to contain the table element. Forms should also be able to
display the fieldset element, and that element is a block level
element.

> Why shouldn't a page have the
> ability to put two forms inline with each other?

It has that ability, but those forms can't be inside a p element.
Isn't that the only block-level element you can't put a form element
inside?

> Doesn't making form
> block-level precludes the possibility, for example, of having both a
> search and a login inline with each other on a top navigation bar?

No. The top navigation bar "<div id="navbar">" is a block elevel
element that can contain form elements. The rest of the elements you
have inside #navbar is inline elements. As long as you don't enclosed
the form elements inside an inline element your html will validate. To
render those form elements as inline elements you could use the
following CSS:

#navbar form { display: inline }

> Here is an example of the page that I am having trouble 
> validating.http://www.j-archive.com/showseason.php?season=25

XHTML 1.1? You have to serve it as 'text/html' to IE. But if you are
serving it as 'text/html' to IE or any other rarely browsers that
don't support Xhtml you should use Xhtml 1.0. It's only Xhtml 1.0 you
may serve as 'text/html' instead of 'application/xhtml+xml'. I DON'T
MIND IF YOU USE CORRECT MIME TYPE.
--~--~---------~--~----~------------~-------~--~----~
--
You received this because you are subscribed to the "Design the Web with CSS" 
at Google groups.
To post: [email protected]
To unsubscribe: [EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---

Reply via email to