开发者

margins/space appearing out of nowhere in mobile browsers.

开发者 https://www.devze.com 2023-04-11 00:10 出处:网络
I\'m working on this page and i\'m having a mobile issue. While the page renders as you see on a computer browser. Loading i开发者_StackOverflow中文版t on an iphone or android phone creates a proble

I'm working on this page and i'm having a mobile issue.

While the page renders as you see on a computer browser. Loading i开发者_StackOverflow中文版t on an iphone or android phone creates a problem in the menu thw you would simulate by adding a margin left and top of each of the elements.

I can't figure out why this happens, I have checked that every element has a margin of zero in the css directly and it sill happens. What else should i try?

On a side note. Is there any reference or list of common CSS/JS/HTML considerations for mobile browser you would reccomend?


Remove the link from before the doctype and put it in the <head> where it belongs.


Before I begin working on any website, I usually reset the CSS.

Most browsers have their own unique default values for elements and they sometimes don't play well with your website.

You can, however, try and override all of these properties to effectively "reset" the CSS.

Yahoo provides a stylesheet you can include (I'd include it before all of your CSS):

<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.4.1/build/cssreset/cssreset-min.css">
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号