[英]Responsive Website, set body to device-width
I want the body of the page to be responsive so that it is easy for the user to read on a mobile site.我希望页面的正文具有响应性,以便用户在移动网站上轻松阅读。 But when I use this line of code.
但是当我使用这行代码时。 I get this mess.
我得到这个烂摊子。 Any suggestions?
有什么建议么?
<meta name="viewport" content="width=device-width">
Thanks in advance!提前致谢!
<!-- Try in this way it may help You --->
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
background-color: yellow;
}
@media only screen and (max-width: 600px) {
body {
background-color: lightblue;
}
}
</style>
</head>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.