我只想知道如何解決這個背景問題?它從 的頂部和底部開始重復.box。有什么解決辦法嗎?
所以這是我的 HTML:
<body>
<div class="box">
<img src="https://s4.uupload.ir/files/e8hzocoxsamec01-removebg-preview_wxkl.png" width="100px"> <be>
I love Unicorns!
</div>
還有我的 CSS:
html, body {
font-family: 'Zen Kurenaido', sans-serif;
display: flex;
justify-content: center;
align-items: center;
background-image: hsla(229, 86%, 81%, 1);
background-image: linear-gradient(225deg, hsla(229, 86%, 81%, 1) 0%, hsla(246, 80%, 75%, 1) 28%, hsla(318, 80%, 79%, 1) 69%, hsla(30, 80%, 75%, 1) 100%);
background-image: -moz-linear-gradient(225deg, hsla(229, 86%, 81%, 1) 0%, hsla(246, 80%, 75%, 1) 28%, hsla(318, 80%, 79%, 1) 69%, hsla(30, 80%, 75%, 1) 100%);
background-image: -webkit-linear-gradient(225deg, hsla(229, 86%, 81%, 1) 0%, hsla(246, 80%, 75%, 1) 28%, hsla(318, 80%, 79%, 1) 69%, hsla(30, 80%, 75%, 1) 100%);
height: 100%;
}
.box {
background-color: #ffffff;
background: rgba(255,255,255,0.3);
border-radius: 2px;
padding: 18px;
width: 400px;
height: 300px;
}
這也是我的代碼筆:Codepen
uj5u.com熱心網友回復:
你的身體不是全寬
在 html,body 下添加
width:100%;
然后重復效果移除。
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/347307.html
