[英]Make responsive css box with text in it
我有三個帶有文本的 css 框。 但是css文本框的高度是固定的:height:800px;
但並非每個 css 文本框都具有相同的文本。 所以一個css文本框沒有那么多文字。 但是你會看到很多空白。
所以我的問題是:
如何制作一個響應式的 css 框?
謝謝
這是CSS:
.box h5{
text-align:center;
position:relative;
top:10px;
}
.box {
width:100%;
height:10px;
background:#FFF;
margin:40px auto;
}
/*==================================================
* Effect 3
* ===============================================*/
.effect3
{
position: relative;
}
.effect3:before
{
z-index: -1;
position: absolute;
content: "";
bottom: 15px;
left: 10px;
width: 50%;
top: 80%;
max-width:300px;
background: #777;
box-shadow: 0 15px 10px #777;
transform: rotate(-3deg);
}
.box h5{
text-align:left;
margin:10px;
position:relative;
top:10px;
}
.box {
width:100%;
height:800px;
background:#FFF;
margin:40px auto;
}
/*==================================================
* Effect 6
* ===============================================*/
.effect6
{
position:relative;
box-shadow:0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
}
.effect6:before, .effect6:after
{
content:"";
position:absolute;
z-index:-1;
box-shadow:0 0 20px rgba(0,0,0,0.8);
top:50%;
bottom:0;
left:10px;
right:10px;
border-radius:100px / 10px;
}
我用 auto 試試,但后來我在 css 框的底部得到了一點文本重疊
我是這樣解決的:
.box h5 {
text-align: left;
margin: 10px;
position: relative;
top: 10px;
padding-bottom: 15px;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.