我有以下代码,这是我从教程中获得的。当我在 Chrome 或 Firefox 上运行时,无论我是否调整窗口大小,都会显示所有两行。我究竟做错了什么?
<html>
<head>
<style>
#content-desktop {display: block;}
#content-mobile {display: none;}
@media screen and (max-width: 768px) {
#content-desktop {display: none;}
#content-mobile {display: block;}
</style>
<meta charset="UTF-8">
<title>Untitled Document</title>
</head>
<div class="content-desktop">
This is the content that will display on DESKTOPS.
</div>
<div class="content-mobile">
This is the content that will display on MOBILE DEVICES.
</div>
<body>
</body>
</html>
万千封印
绝地无双
不负相思意
相关分类