Back to all postsPrevious Post
Mobile DevelopmentXHTMLWeb Development
Mobile Web Development Tips – XHTML
SathishMarch 5, 2010
Developing for mobile devices requires special considerations. Here are some tips for XHTML MP development.
XHTML MP Document Structure
html
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
"http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Mobile Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
<p>Content here</p>
</body>
</html>Best Practices
- **Keep it Simple** - Mobile devices have limited processing power
- **Minimize Images** - Use small, optimized images
- **Avoid Tables for Layout** - Use CSS instead
- **Test on Real Devices** - Emulators don't catch everything
- **Use Relative Units** - em, % instead of px
Content Type
Set the correct content type:
text
Content-Type: application/vnd.wap.xhtml+xmlOr for broader compatibility:
text
Content-Type: application/xhtml+xmlHow to Convert DataTable to XML Programmatically
Next PostHow to Load XML File and Convert to Dictionary
Comments
No comments yet. Be the first to comment.