feat: 实现响应式布局优化,适配移动端设备
- 修改主页和其他页面的宽度为百分比布局,添加最大宽度限制 - 增加媒体查询规则,针对不同屏幕尺寸调整布局和样式 - 优化导航栏、卡片和列表在移动端的显示效果 - 添加滚动条隐藏样式,提升移动端用户体验
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
#homepage-me {
|
||||
width: 1200px;
|
||||
width: 100%;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
box-sizing: border-box;
|
||||
padding: 0 10px;
|
||||
}
|
||||
#homepage-me .matter {
|
||||
align-items: flex-start;
|
||||
@@ -298,7 +301,8 @@
|
||||
margin-right: 7px;
|
||||
}
|
||||
#homepage-me .matter .matter-content .list-area {
|
||||
width: 860px;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #e9eef2;
|
||||
border-radius: 10px;
|
||||
@@ -341,6 +345,13 @@
|
||||
padding-bottom: 23px;
|
||||
padding-left: 95px;
|
||||
padding-right: 40px;
|
||||
overflow-x: auto;
|
||||
justify-content: flex-start;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
#homepage-me .matter .matter-content .list-area .classify::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
#homepage-me .matter .matter-content .list-area .classify .item {
|
||||
width: 50px;
|
||||
@@ -406,3 +417,161 @@
|
||||
color: #7f7f7f;
|
||||
font-size: 14px;
|
||||
}
|
||||
/* 响应式布局优化 */
|
||||
@media screen and (max-width: 880px) {
|
||||
.head-top {
|
||||
margin: 10px auto 15px !important;
|
||||
}
|
||||
.head-navigation {
|
||||
display: none !important;
|
||||
}
|
||||
#homepage-me {
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
}
|
||||
#homepage-me .matter {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
#homepage-me .matter .card-user {
|
||||
width: auto;
|
||||
margin: 0 0 15px 0;
|
||||
padding: 30px 20px;
|
||||
position: static;
|
||||
align-items: center;
|
||||
border-radius: 0;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
}
|
||||
#homepage-me .matter .card-user .avatar-box {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
#homepage-me .matter .card-user .avatar-box .pen-box {
|
||||
right: 50%;
|
||||
margin-right: -60px;
|
||||
}
|
||||
#homepage-me .matter .card-user .name-area {
|
||||
text-align: center;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
#homepage-me .matter .card-user .bi-box {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
#homepage-me .matter .card-user .medal-area {
|
||||
margin: 0;
|
||||
align-self: center;
|
||||
}
|
||||
#homepage-me .matter .card-user .medal-area .list {
|
||||
justify-content: center;
|
||||
}
|
||||
#homepage-me .matter .matter-content {
|
||||
width: 100%;
|
||||
}
|
||||
#homepage-me .matter .matter-content .message-box {
|
||||
width: auto;
|
||||
margin: 0 0 15px 0;
|
||||
padding: 20px;
|
||||
border-radius: 0;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
}
|
||||
#homepage-me .matter .matter-content .message-box .header {
|
||||
padding-top: 0;
|
||||
text-align: center;
|
||||
}
|
||||
#homepage-me .matter .matter-content .message-box .header .avatar {
|
||||
display: none;
|
||||
}
|
||||
#homepage-me .matter .matter-content .message-box .header .username {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
}
|
||||
#homepage-me .matter .matter-content .message-box .info-list {
|
||||
padding-top: 15px;
|
||||
}
|
||||
#homepage-me .matter .matter-content .message-box .info-list .item {
|
||||
width: 50%;
|
||||
padding-right: 10px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
#homepage-me .matter .matter-content .message-box .tags {
|
||||
justify-content: center;
|
||||
}
|
||||
#homepage-me .matter .matter-content .list-area {
|
||||
border-radius: 0;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
}
|
||||
#homepage-me .matter .matter-content .list-area .operation-box {
|
||||
padding: 15px 20px;
|
||||
overflow-x: auto;
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
#homepage-me .matter .matter-content .list-area .operation-box::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
#homepage-me .matter .matter-content .list-area .operation-box .operation-item {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
#homepage-me .matter .matter-content .list-area .operation-box .operation-item:not(:last-child) {
|
||||
margin-right: 30px;
|
||||
}
|
||||
#homepage-me .matter .matter-content .list-area .classify {
|
||||
padding: 10px 20px 20px;
|
||||
overflow-x: auto;
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
#homepage-me .matter .matter-content .list-area .classify::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
#homepage-me .matter .matter-content .list-area .classify .item {
|
||||
flex-shrink: 0;
|
||||
width: auto;
|
||||
padding: 0 15px;
|
||||
}
|
||||
#homepage-me .matter .matter-content .list-area .issue-data {
|
||||
padding: 0 20px 15px;
|
||||
}
|
||||
#homepage-me .matter .matter-content .list-area .list-box {
|
||||
padding: 0 20px;
|
||||
}
|
||||
#homepage-me .matter .matter-content .list-area .empty {
|
||||
width: auto;
|
||||
height: auto;
|
||||
min-height: 200px;
|
||||
margin: 20px;
|
||||
padding: 40px 0;
|
||||
}
|
||||
#homepage-me .matter .matter-content .list-area .empty .empty-icon {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
}
|
||||
#homepage-me .matter .matter-content .list-area .load-more {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 480px) {
|
||||
#homepage-me .matter .card-user .bi-box {
|
||||
width: 100%;
|
||||
max-width: 320px;
|
||||
}
|
||||
#homepage-me .matter .card-user .bi-box .bi-masking {
|
||||
width: 100%;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
#homepage-me .matter .matter-content .message-box .info-list .item {
|
||||
width: 100%;
|
||||
margin-bottom: 12px;
|
||||
justify-content: space-between;
|
||||
}
|
||||
#homepage-me .matter .matter-content .message-box .info-list .item .label {
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user