Html CSS媒体查询仅适用于浏览器调整大小(边缘)
我有一个网站kryptobank.co.uk,它使用媒体查询进行响应。这有点像一个新闻文章网站。甚至还没有开发,只是有伪造的数据和文字。该设计在edge浏览器上运行良好。当我调整窗口大小时,我可以看到flex box属性生效。然而,这是它唯一可以使用的浏览器。当我在桌面上调整chrome浏览器的大小或在手机上使用三星浏览器时,它无法工作。即使大小还没有达到我设置的769px,它也会应用媒体查询属性。我只有一个名为index.css的css样式表。这是一片混乱,但这就是它的样子Html CSS媒体查询仅适用于浏览器调整大小(边缘),html,css,flexbox,microsoft-edge,Html,Css,Flexbox,Microsoft Edge,我有一个网站kryptobank.co.uk,它使用媒体查询进行响应。这有点像一个新闻文章网站。甚至还没有开发,只是有伪造的数据和文字。该设计在edge浏览器上运行良好。当我调整窗口大小时,我可以看到flex box属性生效。然而,这是它唯一可以使用的浏览器。当我在桌面上调整chrome浏览器的大小或在手机上使用三星浏览器时,它无法工作。即使大小还没有达到我设置的769px,它也会应用媒体查询属性。我只有一个名为index.css的css样式表。这是一片混乱,但这就是它的样子 /* ======
/* =================================
Base Layout Styles
==================================== */
/* ---- Navigation ---- */
.main-header {
background-color: #fff;
margin: 0 auto;
}
.name, .main-nav {
text-align: center;
}
.name {
text-shadow: 1px 2px rgba(0,0,0,0.8)
}
ul li {
list-style-type: none;
}
/* ---- Layout Containers ---- */
.price-card{
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
border: 1px solid black;
width: 300px;
padding: 20px;
margin: auto;
border-radius: 10px;
margin-top: 20px;
}
.price-card p {
margin-top: -15px;
font-size: 10px;
}
.price-card span{
font-size: 20px;
font-weight: bold;
margin-bottom: -15px;
}
.container{
display: flex;
flex-wrap: wrap;
flex-basis: 300px;
}
.intro-heading{
text-align: left;
border-bottom: 2px solid #000;
margin-bottom: 5px;
}
.price {
width: 80%;
margin: 0 auto;
}
.top-three {
text-align: left;
margin: 0;
}
.title h1,
.title span,
.title a{
color: white;
background-color: #000000;
display: inline;
}
.list h1,
.list span {
color: #000;
background-color: #fff;
display: inline;
}
.primary{
height: 390px;
width: 99%;
margin: 7px auto;
background-repeat: no-repeat;
background-size: cover;
background-position: center;
border-top: 10px solid firebrick;
}
.list{
height: 390px;
width: 99%;
margin: 7px auto;
background-repeat: no-repeat;
background-size: cover;
background-position: center;
margin: 5px 5px;
border-top: 10px solid firebrick;
}
.back-image{
height: 390px;
width: 100%;
margin: 7px auto;
background-repeat: no-repeat;
background-size: cover;
background-position: center;
border-top: 10px solid #ffa949;
}
.back-image h1,
.back-image span {
color: #000;
background-color: #fff;
display: inline;
}
.content{
width: 80%;
margin: 10px auto;
max-width: 900px;
}
.content p {
font-family: Arial, Helvetica, sans-serif;
font-size: 24px;
font-weight: 500;
}
h2 span {
font-size: 12px;
}
/* ---- Page Elements ---- */
a:link {
/* Applies to all unvisited links */
text-decoration: none;
font-weight: bold;
}
a:visited {
/* Applies to all visited links */
text-decoration: none;
font-weight: bold;
}
a:hover {
/* Applies to links under the pointer */
text-decoration: underline;
font-weight: bold;
}
a:active {
/* Applies to activated links */
text-decoration: underline;
font-weight: bold;
}
/* =================================
Flexbox
==================================== */
@media only screen and (min-width: 769px){
.top-three {
display: flex;
flex-direction: row;
}
.name, .main-nav {
text-align: center;
}
ul li {
display: inline;
background-color: #000;
margin-right: 15px;
}
li a {
color: #fff;
}
.latest-10,
.all{
display: flex;
flex-wrap: wrap;
}
.list{
flex-grow: 1;
flex-basis: 300px;
}
}
这是HTML页面
<body>
<header>
<h1 class="name"><a href="/">KYPTOBANK</a></h1>
<ul class="main-nav">
<li><a href="/">01 - HOME</a></li>
<li><a href="/articles/">02 - NEWS</a></li>
<li><a href="#">03 - CURRENCY EXCHNAGE</a></li>
<li><a href="#">04 - ABOUT</a></li>
<li><a href="#">05 - CONTACT</a></li>
</ul>
</header><!--/.main-header-->
<div id="root"></div>
<h2 class="intro-heading">Top Three</h2>
<div class="top-three">
<div class="primary" style="background-image:url(http://themarketmogul.com/wp-content/uploads/2017/06/india_money_1498129850.jpg)">
<div class="title">
<h1> <a href="/articles/1/">How India's Demonstartion has change Paytm's Fortunes</a></h1>
<br>
<span>Emerging Economy</span>
</div>
</div>
<div class="primary" style="background-image:url(http://themarketmogul.com/wp-content/uploads/2017/06/pexels-photo-136721.jpeg)">
<div class="title">
<h1> <a href="/articles/2/">Hear The Drums Echoing Tonight? The Relentless March Of Online Money Transfers In Africa</a></h1>
<br>
<span>Africa Emerging</span>
</div>
</div>
<div class="primary" style="background-image:url(http://themarketmogul.com/wp-content/uploads/2017/06/trading_1498053453.jpg)">
<div class="title">
<h1> <a href="/articles/3/">Raise The Stakes: Learn How To Improve The Win/Loss Ratio</a></h1>
<br>
<span>London Rising</span>
</div>
</div>
</div>
<h2 class="intro-heading">Latest Articles</h2>
<div class="latest-10">
<div class="list" style="background-image:linear-gradient(#ffa949, transparent 90%),linear-gradient(to top, #fff, transparent),url(https://media.coindesk.com/uploads/2017/06/shutterstock_307175279.jpg);">
<h1> <a href="/articles/4/">GDAX Exchange to Reimburse Traders After Ether Flash Crash</a></h1>
<br>
<span>Market Collapse</span>
</div>
<div class="list" style="background-image:linear-gradient(#ffa949, transparent 90%),linear-gradient(to top, #fff, transparent),url(https://media.coindesk.com/uploads/2017/06/shutterstock_307175279.jpg);">
<h1> <a href="/articles/5/">GDAX Exchange to Reimburse Traders After Ether Flash Crash</a></h1>
<br>
<span>Market Collapse</span>
</div>
<div class="list" style="background-image:linear-gradient(#ffa949, transparent 90%),linear-gradient(to top, #fff, transparent),url(https://media.coindesk.com/uploads/2017/06/shutterstock_307175279.jpg);">
<h1> <a href="/articles/6/">GDAX Exchange to Reimburse Traders After Ether Flash Crash</a></h1>
<br>
<span>Market Collapse</span>
</div>
<div class="list" style="background-image:linear-gradient(#ffa949, transparent 90%),linear-gradient(to top, #fff, transparent),url(https://media.coindesk.com/uploads/2017/06/shutterstock_307175279.jpg);">
<h1> <a href="/articles/7/">GDAX Exchange to Reimburse Traders After Ether Flash Crash</a></h1>
<br>
<span>Market Collapse</span>
</div>
<div class="list" style="background-image:linear-gradient(#ffa949, transparent 90%),linear-gradient(to top, #fff, transparent),url(https://media.coindesk.com/uploads/2017/06/shutterstock_307175279.jpg);">
<h1> <a href="/articles/8/">GDAX Exchange to Reimburse Traders After Ether Flash Crash</a></h1>
<br>
<span>Market Collapse</span>
</div>
<div class="list" style="background-image:linear-gradient(#ffa949, transparent 90%),linear-gradient(to top, #fff, transparent),url(https://media.coindesk.com/uploads/2017/06/shutterstock_307175279.jpg);">
<h1> <a href="/articles/9/">GDAX Exchange to Reimburse Traders After Ether Flash Crash</a></h1>
<br>
<span>Market Collapse</span>
</div>
</div>
前三名
新兴经济体
非洲正在崛起
伦敦崛起
最新文章
市场崩溃
市场崩溃
市场崩溃
市场崩溃
市场崩溃
市场崩溃
您可以自己查看该网站 在我的chrome浏览器上可以调整大小,但是在设备上,我认为您需要添加一个viewport meta标记,以便站点知道正在查看的设备:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
自2017年6月27日起使用铬合金。尝试添加一个
<meta name="viewport" content="width=device-width, initial-scale=1.0">
可以找到指南这是正确的URL吗?我收到了一个“错误的请求400:是的,这是正确的URL。它现在对我来说很好,除非你写错了。该网站是像10%,这样做可能会有400或500个错误等发现的问题。只需写kryptobank.co.uk,开头不用www。这是一个糟糕的URL。