Quote:
Originally Posted by carlitos_way
the label "cognome" should be aligned vertically with his respective input field...
how can this be done?
|
I would put the form elements in container elements and float said containers.
Code:
div { float: left; }
div * { display: block; }
Code:
<div>
<label for="nome">nome</label>
<input type="text" id="nome">
</div>
<div>
<label for="cognome">cognome</label>
<input type="text" id="cognome">
</div>
Additionally, I would fix all of
the errors shown by the W3C validator and
those errors shown by the Validome validator. In addition to those errors, there are some weird things going on.
- There’s a paragraph element with no content.
- A form element has an empty action attribute. If you’re not going to use the attribute, you may as well omit the element or replace it with a more generic div element.
- There are numerous empty value attributes. You may as well remove them since they’re redundant.
- You have redundant value attributes. <option>30</option> is the same as <option value="30">30</option>.
- There are anchor elements whose only content is a no‐break space ( ) character. The character seems to serve no purpose.
- Anchor elements are being used to mark up asterisk (*) characters; I’m not sure why. The generic span is probably more appropriate. Regarding accessibility, I’m not sure how screen readers are supposed to tell that the asterisk indicates a required field.
- You have two buttons with the same tabindex value, the value is zero, and one wonders why the first thing you would want to access in a form are the check and reset buttons. I would expect the user to want to fill out the form first.
- You have a copyright notice that doesn’t state what’s copyrighted. IMO, it’s strange to claim copyright over an HTML/XHTML form.
Other Issues
- I would not use inline CSS for maintenance reasons. An embedded style sheet that uses the style element is better than inline CSS.
- Avoid presentational elements such as br.
- You may want to consider what the advantages of using XHTML are. If none, then I would recommend use of HTML instead.
- mailto: tends not to work unless the user has and uses a locally configured email program.