If you feel like you can't contribute yourself, but have a good question, post it here so that I or some other member on these forums can write it if they feel like they can do it well. If you have any input on the questions already answered in it, post that input here.
Code snippets should be wrapped in [code][/code] blocks.
Comments within code blocks should be wrapped in [color=green][/color].
Script snippets in running text should be wrapped in [color=blue][/color].
If you write an example of an error, the code causing the error should be wrapped in [color=red][/color].
Use [i][/i] to wrap text that the user should replace by own code.
In running text, use [b][/b] to wrap JavaScript objects.
Please don't include your signature if it isn't relevant to the question, and make sure that no part of any script snippets included in the post are replaced by smilies.
Hi, could you comment this Q/A before I post it? Thanks a lot. Don't hesitate to point out typo as well as grammar syntax problems. Thank you very much.
A: The forms layouts usually rely heavily on tables to keep everything lined up. You can easily achieve the same thing by applying a little CSS to your page.
Using tables, you would line up your form elements like that:
You can easily achieve the same thing using CSS. Here is the CSS part:
Code:
form p {
width: 350px;
clear: both;
}
form p label {
display: inline;
float: left;
width: 100px;
}
form p input, form p textarea, form p select {
margin: 0;
}
Labels float to the left of the paragraphs appearing within forms while form fields will apear to the right. To make it short, the clear property will achieve what the </tr><tr> used to do. Note that my explanations are based on Dan Shafer's book 'HTML Utopia, Designing Without Tables Using CSS'.
For consistency, add these:
- You have no "Q: " in the title.
- You have no colon after the "A" in the body.
- Use [color=blue][/color] to wrap running parts of code in the text.
A couple of other things:
- Please indent the code samples to make them easier to read.
- Floating labels not at all appearing is an old moz bug. I don't know if it's fixed yet, but since 1.2, Netscape 7.0 and Camino 0.7 are all affected I'd say you should be very wary of this and make sure you test the code in at least one of the browsers I mentioned.
Have done. There appears to be a problem with the Table of Contents, though. I assume you just put [url=#postxxxxx], but VBulletin appears to have parsed it as http://#postxxxxx, meaning all those links are invalid.
Would adding a link to this page and quoting the following text be enough? I could also post an alternate code using span but it should be ok. What do you think David? Any suggestions about my code are more than welcome.
Notes
Older versions of Safari didn't support legend, just the fieldset border is visible. Camino (post-Chimera) has a bug causing floated labels are replaced with input fields. Buggy Opera6/Mac: legend is displayed inside the fieldset (among other text). MSIE/Mac only displays legend on the right side if text-align:right is specified. NS6 fails badly on these constructs (thanks to Manuel Razzari); however, NS7 works fine.
Originally posted by liorean Darn you Alex, you beat me to that. I was writing on the same third question! Oh well, I guess I'll have to find some other topic to write on.
I guess great minds think alike. I just hope my answer didn't leave anything out for someone new to the idea of XHTML. (No way am I going to inflict the full complexibility of possibilites XML offers in a thread like that!)
The XML FAQ thread is wide open...
__________________
"The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
June 30, 2001
author, Verbosio prototype XML Editor
author, JavaScript Developer's Dictionary https://alexvincent.us/blog
Last edited by Alex Vincent; 03-16-2004 at 02:58 AM..