我现在非常困惑,所以我试图创建一个响应式的网站。
由于某种原因,我的媒体查询没有触发?我有下面的CSS和它的工程从X-小低于480px和高达575.98px。但是在过去的媒体查询中,我添加到767.98px范围的任何东西都不起作用?
@media only screen and (min-width : 480px) {
.card-4{
display: none;
}
}
@media (max-width: 575.98px) {
#about{
padding: 0 0.5rem 0 0.5rem;
}
.about-photo img{
width: 70%;
}
.about-text{
margin: auto;
text-align: center;
padding: 1rem 0 3rem 0;
}
.about-text h1, .about-text p{
text-align: center;
float: none;
}
.table{
margin: 0;
padding-left: 0;
}
.table li{
margin: auto;
padding-top: 0.3rem;
padding-left: 2rem;
text-align: left;
}
#skills-list{
margin: 0 2rem 0 2rem;
}
#skills-list li{
text-align: left;
padding-bottom: 1rem;
}
.card-1{
display: none;
}
.card{
margin-left: auto !important;
margin-right: auto !important;
text-align: center;
}
.cards-container{
margin: 0 !important;
}
.timeline > li > .timeline-panel {
width: 85%;
float: right;
padding: 1.2rem;
}
.timeline:before {
left: 6%;
}
.timeline > li > .timeline-badge {
width: 44px;
height: 44px;
left: 6%;
}
.timeline > li > .timeline-panel:before {
border-left-width: 0;
border-right-width: 15px;
left: -15px;
right: auto;
}
.timeline > li > .timeline-panel:after {
border-left-width: 0;
border-right-width: 14px;
left: -14px;
right: auto;
}
.square-1-text, .square-2-text, .square-3-text{
height: 31rem;
}
.square-1{
order:1;
}
.square-1-text{
order:2;
}
.square-2{
order:3;
}
.square-2-text{
order:4;
}
#passions-section{
padding-bottom: 0;
}
#skills-list li.i{
list-style-position: outside !important;
display: none;
}
/*// Small devices (landscape phones, less than 768px)*/
@media (max-width: 767.98px) {
}
/*// Medium devices (tablets, less than 992px)*/
@media (max-width: 991.98px) {
}
/*// Large devices (desktops, less than 1200px)*/
@media (max-width: 1199.98px) {
}发布于 2018-06-10 02:05:02
在实现完全响应的站点时,在CSS媒体查询中使用正确的断点可能是最重要的决定。
最小宽度: 320px (较小的手机视点)最小宽度: 480px (小型设备和大多数手机)最小宽度: 768px (大多数平板电脑)最小宽度: 992px (较小的桌面视点)最小宽度: 1200px (大型设备和宽屏)
在你的情况下,试试这个
@media (min-width:500px) and (max-width:750px)https://stackoverflow.com/questions/50777050
复制相似问题