Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
front-end-tech:xhtml:best-practices [Jul 6, 2026 08:29 PM] 45.163.191.6 removed |
— (current) | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | = HTML / XHTML Best Practices = | ||
| - | |||
| - | === HTML vs. XHTML === | ||
| - | |||
| - | There are pros and cons to both [[HTML vs. XHTML|HTML and XHTML]]. | ||
| - | |||
| - | == ID vs. Name in Form Fields == | ||
| - | |||
| - | When creating form fields, you need to give them both a '' | ||
| - | |||
| - | == Use < | ||
| - | |||
| - | ''< | ||
| - | |||
| - | Use it like this:< | ||
| - | <!-- if somebody clicks on the text 'Enter Your First Name', then | ||
| - | the cursor will be put in the ' | ||
| - | <label for=" | ||
| - | <input type=" | ||
| - | </ | ||
| - | == Make sure every form has a proper submit button or image == | ||
| - | |||
| - | It's rather popular these days to [[front-end-tech: | ||
| - | |||
| - | This works great if you click, but falls apart in Firefox and IE6/7 if a user presses enter in the form. Thus **always be sure to include a real submit button**, either a true ''< | ||
| - | |||
| - | == ALWAYS use & and not & ... even in URLs == | ||
| - | |||
| - | It's a fairly well known fact that you need to encode certain characters, such as ampersand, as an HTML entity. In other words, use ''& | ||