Best examples of using mobile CSS

What styles should I override / reset on the mobile network? Are there any patterns similar to desktop networks when you set margin: 0; padding: 0; margin: 0; padding: 0; to any item from the start? Are there any consequences if I reset too many styles / elements?

+4
source share
1 answer

If you really want to reset: Carrer blog has one : (github)

 /* CSS Mobile Reset */ html, body { margin: 0; padding: 0; border: 0; } body { font-family:Arial, sans-serif; line-height:1.5; font-size:16px; background: #fff; padding:5px; color: #000; word-wrap: break-word; -webkit-text-size-adjust: none; } h1, h2, h3, h4, h5, h6{ font-weight: normal; } p img { float: left; margin: 0 10px 5px 0; padding: 0; } img { border: 0; max-width: 100%; } table { width:auto; border-collapse: collapse;border-spacing: 0; } 

Must read SO post on this. From Harpo:

How much do you believe in CSS reset for the desktop?

I tend to agree with those who claim CSS reset too (have you ever read?) I never heard of some of these elements), and that ultimately manual rules based on your actual needs will be most predictable and effective.

A mobile platform makes bandwidth even more valuable. I guess that’s why you ask. I would say destroy standard reset to what you really need.

If you are in the Boilerplate: there is an option for mobile devices.

You might want to add some of your functions yourself, even if you are not using a template.

+5
source

Source: https://habr.com/ru/post/1381824/


All Articles