以下是屏幕快照,其中包含OK文本作为元素,左侧和右侧以及最后一个按钮中包含2个其他元素。



.center-text {
	font-weight: bold;
	font-style: normal;
	text-align: center;
	font-size: 25px;
	line-height: 30px;
	letter-spacing: normal;
	opacity: 1.0;
	margin-top: 25% !important;
}
.lower-content {
	margin-bottom: 30px;
}
.group:before, .group:after {
	content: "";
	display: table;
}
.group:after {
	clear: both;
}
.group {
	clear: both;
 *zoom: 1;
}
.lower-content-left {
	float: left;
	margin: 0 1.5%;
	width: 63%;
}
.lower-content-right {
	float: right;
	margin: 0 1.5%;
	width: 30%;
}
.button-left {
	position: absolute;
	width: 140px;
	height: 140px;
	left: 100px !important;
	right: 0;
	bottom: 0;
	top: 620px;
}
.button-left>div {
	width: 100px;
	height: 100px;
}
.notification-button {
	margin-left: 15px;
	margin-top: 10px;
	zoom: 2.0;
}
.button-right {
	position: absolute;
	width: 140px;
	height: 140px;
	left: 250px;
	right: 20px;
	bottom: 0;
	top: 620px;
}
.button-right>div {
	width: 100px;
	height: 100px;
}
.heart-button {
	margin-left: 15px;
	margin-top: 10px;
	zoom: 2.0;
}

<div class="center-text">Ok</div>

<div class="group">

<div class="lower-content-left">
  <div class="lower-left">click here</div>
  <div class="search-channels">Click
    <br>Here</div>
</div>

<div class="lower-content-right">
  <div class="lower-right">Otherwise Click here</div>
  <div class="qrCode">Click here
    <br>Also</div>
</div>

<div class="button-left">
  <div>
    <ion-icon name="notification" class="notification-button"></ion-icon>
  </div>
</div>

<div class="button-right">
  <div>
    <ion-icon name="heart" class="heart-button"></ion-icon>
  </div>
</div>





问题:当我改变屏幕的宽度时,按钮隐藏或不在当前位置出现,并且对所有元素都相同。
我已经在屏幕截图中发布了,我只需要编辑css使其根据屏幕截图做出响应即可。

html - 如何针对不同的宽度和高度快速调整元素-LMLPHP

最佳答案

尝试通过解析来使用CSS。

例:

@media (max-width: 300px) {
    .your-class {
        your:option; }
        }

@media (max-width: 600px) {
    .your-class {
        your:option; }
        }

07-24 09:46
查看更多