CSS 模态框居中显示并留空,响应式调整宽度
.modal-content { width: 80%; /* 缩小至屏幕宽度的80% / margin: auto; / 居中 / padding: 20px; / 上下留空 */ }
.modal-header { border-bottom: 1px solid #ccc; padding: 10px; text-align: center; }
.modal-title { font-size: 18px; font-weight: 600; margin: 0; }
.modal-body { padding: 10px; }
.table-responsive { overflow-x: auto; }
.table { margin-bottom: 0; }
.table th { font-weight: 600; text-align: center; }
.table td { text-align: center; }
.btn-close { position: absolute; top: 10px; right: 10px; }
@media (max-width: 767px) { .modal-content { width: 95%; /* 在小屏幕下缩小至屏幕宽度的95% */ } }
原文地址: https://www.cveoy.top/t/topic/nKp4 著作权归作者所有。请勿转载和采集!