How is the meta viewport tag used, and what does it do?

前端 未结 4 1913
执笔经年
执笔经年 2020-12-01 06:48
  1. What browsers support this meta tag?
  2. How do i use it?
  3. Does this mean it will solve all my mobile resizing problems?

If anyone could an

4条回答
  •  时光取名叫无心
    2020-12-01 07:15

    1. The viewport browser support is a little bit across the board. I'll point you to the Quirksmode page for viewport browser support for the full details.
    2. You use the viewport meta tag like any other meta tag. Put the code block straight up in the .
    3. Pretty much, but again, a little bit of a mouthful to say here. I'd advise reading some articles, reading the W3 mobile best practices for web design, or the current W3 draft specifications on the viewport attribute for the tag.

    In short, adding this line to a website that should implement viewport scaling should fix most problems. (copied from WebDesignTuts+'s "Quick Tip: Don't Forget the Viewport Meta Tag" article)


    P.S. Quirksmode also has a rather wonderful article describing the issue that's worth reading to understand why this might be helpful.

提交回复
热议问题