Reputation: 11613
I'd like to include mark-up that makes it easier for users of text-based browsers (links, elinks, lynx) to consume my site. I'll be able to serve this special version of the site based on useragent, however what mark-up features do text-based browsers handle especially well?
Upvotes: 15
Views: 625
Reputation: 10386
You can check for the user agent string. Here is a comprehensive list. You could check for lynx, links, elinks and w3m. However, it's better not to check for the agent string at all, and keep the html clean and simple. Some of the text-mode browsers, like elinks, does have some javascript support. The CSS-support varies, but the underlying html would still work.
Some text-mode browsers, like links, have a graphic mode, where images can be shown as well.
If you stick to <html>
, <body>
, <h1>
, <p>
, <a href="...">
and use alt="..."
for any images, you can't go wrong.
Upvotes: 1
Reputation: 28906
To best server text-based browsers, ensure that you use simple, semantic markup. Keep the mantra "Content is King" in mind as you build your site, and design the structure around the content rather than around a visual template.
When your content takes precedence, your page will be uncluttered by the extra markup and visual elements that may confuse the text-based browsers.
Upvotes: 0
Reputation: 31296
Your best bet is just to make heavy use of CSS for all the formatting. It's unlikely that text-based agents will support everything, so providng you drop all style info in an external stylesheet (mostly for ease of maintenance), and just use class
attributes where needed, then you'll probably find the site degrades gracefully. Most (all?) browsers come with some form of developer toolbar so you can disable styles within, say, Firefox, IE, Chrome [whatever] on demand and you'll get an idea how it's likely to be seen by text-only browsers.
The only thing to be careful of is tables -- lynx doesn't support them, but other text-based browsers do (to a greater or lesser extent). Again, just make sure the page degrades gracefully as far as it possibly can.
Ultimately using CSS for all your layout and a chunk of your formatting should mean that most worries related to text-based should be resolved.
Upvotes: 14
Reputation: 2503
I don't know any special markup you would need for that. Maybe just less markup than usual. Use JS as little as possible since they have only marginal support. Any markup that is there to make site look "nice" in modern browsers when using CSS and fancy alignment is most likely worthless there and may be hindrance. Depending on content you might want use simple text. Or old style pages(quite some GNU pages like this). Example in on-line version of "Art of Unix programming" (http://www.faqs.org/docs/artu/index.html), very simple design that is easy to read and render anywhere. No fancy or any implied design, just text some links and you. Though it might not be suitable for all types of content. Basically keep it as simple as possible and try to avoid fancy layouts, or any layouts at all since some of these browsers simply render block elements one after another and menus that would be on left or right get to bottom or take up whole first screen with no content showing until one scrolls down. In my opinion horizontal top menus work best. And of course see how it looks for your self by testing and navigating there a bit.
Upvotes: 2