feat: 实现响应式布局优化,适配移动端设备
- 修改主页和其他页面的宽度为百分比布局,添加最大宽度限制 - 增加媒体查询规则,针对不同屏幕尺寸调整布局和样式 - 优化导航栏、卡片和列表在移动端的显示效果 - 添加滚动条隐藏样式,提升移动端用户体验
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
#homepage-other {
|
||||
width: 1200px;
|
||||
width: 100%;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
box-sizing: border-box;
|
||||
padding: 0 10px;
|
||||
}
|
||||
#homepage-other .head-navigation {
|
||||
margin-bottom: 20px;
|
||||
@@ -205,7 +208,8 @@
|
||||
margin-right: 7px;
|
||||
}
|
||||
#homepage-other .matter .matter-content .list-area {
|
||||
width: 860px;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #e9eef2;
|
||||
border-radius: 10px;
|
||||
@@ -272,3 +276,130 @@
|
||||
color: #7f7f7f;
|
||||
font-size: 14px;
|
||||
}
|
||||
@media screen and (max-width: 900px) {
|
||||
#homepage-other .matter {
|
||||
flex-direction: column;
|
||||
}
|
||||
#homepage-other .matter .card-user {
|
||||
width: 100%;
|
||||
margin-right: 0;
|
||||
margin-bottom: 20px;
|
||||
position: static;
|
||||
padding: 20px;
|
||||
}
|
||||
#homepage-other .matter .card-user .avatar {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
#homepage-other .matter .card-user .btn-area {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
width: 100%;
|
||||
}
|
||||
#homepage-other .matter .card-user .btn-area .item {
|
||||
flex: 1;
|
||||
width: auto;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
#homepage-other .matter .matter-content {
|
||||
width: 100%;
|
||||
}
|
||||
#homepage-other .matter .matter-content .message-box {
|
||||
padding: 20px;
|
||||
}
|
||||
#homepage-other .matter .matter-content .message-box .header {
|
||||
display: none;
|
||||
}
|
||||
#homepage-other .matter .matter-content .message-box .info-list {
|
||||
padding: 0;
|
||||
}
|
||||
#homepage-other .matter .matter-content .message-box .info-list .item {
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
}
|
||||
#homepage-other .matter .matter-content .list-area {
|
||||
padding: 20px;
|
||||
}
|
||||
#homepage-other .matter .matter-content .list-area .classify {
|
||||
overflow-x: auto;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
#homepage-other .matter .matter-content .list-area .classify .item {
|
||||
width: auto;
|
||||
padding: 0 10px;
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
font-size: 13px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
#homepage-other .matter .matter-content .list-area .empty {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 480px) {
|
||||
#homepage-other .head-navigation {
|
||||
font-size: 12px;
|
||||
}
|
||||
#homepage-other .matter .matter-content .list-area {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
#homepage-other .matter .matter-content .list-area .classify {
|
||||
padding: 20px 0;
|
||||
}
|
||||
#homepage-other .matter .matter-content .list-area .classify .item {
|
||||
padding: 0 7px;
|
||||
}
|
||||
#homepage-other .matter .card-user .btn-area {
|
||||
flex-direction: column;
|
||||
}
|
||||
#homepage-other .matter .card-user .btn-area .item {
|
||||
flex: none;
|
||||
width: 100%;
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 430px) {
|
||||
#homepage-other .matter .matter-content .list-area .classify .item:not(:last-child) {
|
||||
margin-right: 7px;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 1015px) {
|
||||
.item-box .bottom .bottom-item:not(:last-child) {
|
||||
margin-right: 45px;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 955px) {
|
||||
.item-box .bottom .bottom-item:not(:last-child) {
|
||||
margin-right: 30px;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 900px) {
|
||||
.head-top .post-list,
|
||||
.head-top .sign-in {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 480px) {
|
||||
.head-top .logo {
|
||||
height: 30px;
|
||||
width: auto;
|
||||
}
|
||||
.head-top .input-box {
|
||||
background: transparent !important;
|
||||
border: none !important;
|
||||
width: auto !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
.head-top .input-box .placeholder,
|
||||
.head-top .input-box .input,
|
||||
.head-top .input-box .search-box-history {
|
||||
display: none !important;
|
||||
}
|
||||
.head-top .input-box .icon {
|
||||
margin: 0 10px;
|
||||
display: block !important;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user