Home >> FAQs/Tutorials >> XHTML Tutorials and Tips >> Index

XHTML Tutorial - Writing XHTML Element Attributes

By: FYIcenter.com

(Continued from previous topic...)

How To Write Element Attributes Properly?

If an attribute is allowed for an XHTML element, you must write the attribute inside the opening tag of this element. Here are some rules on writing element attributes:

  • An attribute must have a name and a value, separated by the equal sign "=".
  • An attribute name must be written in lower case letter.
  • An attribute value must be enclosed in a pair of quotes.
  • Multiple attributes can be written in any order.
  • Some attributes must use predefined values.

Here are some good examples of element attributes:

  • <td colspan="2"> - One attributes: "colspan".
  • <input type="text" name="Phone"> - Two attributes: "type" and "name".
  • <link rel="stylesheet" type="text/css" href="_local.css"/> - Three attributes: "rel", "type" and "href".

(Continued on next topic...)

  1. What Is an XHTML Element?
  2. How To Enter Comments into XHTML Documents?
  3. How To Write the Opening Tag of an XHTML Element?
  4. How To Close an XHTML Element?
  5. What Is Wrong with My <br> Tags?
  6. What Is Wrong with My <meta> Tags?
  7. How To Enter Element Content?
  8. Is XHTML Element Name Case Sensitive?
  9. What Is an XHTML Element Attribute?
  10. How To Write Element Attributes Properly?
  11. Is Attribute Name Case Sensitive?
  12. How To Quote Element Attribute Values Properly?
  13. How To Write Ampersand Sign in Attribute Values?
  14. What Is a Required Attribute?
  15. What Are Predefined Attribute Values?
  16. What Is Wrong with My "checked" Attribute Values?

Selected Developer Jobs: