Harry
Harry

Reputation: 489

HTML CSS for mobiles

Is there is any difference in writing html and css for mobile from web??

Upvotes: 1

Views: 1253

Answers (5)

Scott Vander Molen
Scott Vander Molen

Reputation: 6439

As others have mentioned, the level of CSS support among mobile devices varies even more than on the desktop. What others have not mentioned, however, is a fairly major annoyance that mobile developers need to be aware of: dual CSS media types.

Some (many?) mobile browsers advertise acceptance of both screen and handheld media types. This means that serving a handheld stylesheet is not enough, because the device will also apply the rules from the screen stylesheet.

To overcome this, it is sometimes sufficient to explicitly set rules in your handheld stylesheet for things you would have otherwise omitted. In some cases, it may be necessary to flag certain rules as important.

Other than that, stick to single column layout, go easy on the images, and everything should be fine. And I hope you're not relying on JavaScript, because some mobile browsers don't support it.

Upvotes: 0

FelipeAls
FelipeAls

Reputation: 22181

If you enjoyed (sarcasm) the diversity of web browsers, you're going to love mobile phones, browsers and carriers. PPK got paid by Verizon Germany to do some tests so he got to play with the whole set of phones sold by the carrier and it gave theses posts and tables.

Just horrible.

Upvotes: 1

zombat
zombat

Reputation: 94237

The way HTML and CSS is interpreted is completely in the realm of the web browser. Standards have been established, and most major browsers attempt to adhere to these standards these days.

As long as the mobile platform has a browser that implements CSS and HTML in a standard way, then no, there's no difference in writing HTML and CSS for a mobile device.

How you want your web page to look on such a device might be completely different however, and you might need to write a second set of HTML/CSS to present the same data to a mobile browser.

Upvotes: 1

Kip
Kip

Reputation: 109503

It really depends a lot on how modern the mobile devices are, or at least the ones that you are supporting. iPhone, for example, behaves nearly identically to desktop Safari (except the notable absence of Flash). But middle-of-the-line phones from 3+ years ago barely support text-only browsing.

Upvotes: 0

MyItchyChin
MyItchyChin

Reputation: 14041

Yes. There's a difference in CSS for each different browser you're targeting!

Upvotes: 0

Related Questions