简体   繁体   中英

meta viewport: can not use “width=640” with “initial-scale=1.0”?

when I set viewport with

<meta name="viewport" content="width=640">

I can create a square div takes half of the screen by following css

.sq {
  width: 320px;
  height: 320px;
  background-color: coral;
}

在此处输入图片说明

but I after I modify it to

<meta name="viewport" content="width=640, initial-scale=1.0">

it seems broken, the square with 320px width takes more than half of the screen.

在此处输入图片说明

what does "initial-scale=1.0" do here, can anyone tell me the details ?

以px为单位

<meta name="viewport" content:"width=640px">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM