gpt4 book ai didi

html - 使用固定背景附件和旋转容器重复背景?

转载 作者:行者123 更新时间:2023-11-28 02:35:36 25 4
gpt4 key购买 nike

是否有可能在以下条件下获得无缝模式重复?

想法是有一个固定附件的旋转背景。我认为这是应该的工作方式,但有什么方法可以实现吗?

body {
padding: 50px;
margin: 0;
height: 10000px;
}

.main {
width: 100%;
height: 1300px;
box-sizing: border-box;
overflow: hidden;
border: 5px solid #7cb7b7;
position: relative;
display: flex;
justify-content: center;
align-items: center;
}

.background {
background-image: url('https://thumbs.dreamstime.com/b/circles-seamless-pattern-10032830.jpg');
background-attachment: fixed;
background-repeat: repeat;
position: absolute;
top: -1000%;
left: -1000%;
right: -1000%;
bottom: -1000%;
transform: rotate(-15deg);
}

.text {
background: white;
border: 2px solid black;
width: 200px;
height: 70px;
display: flex;
justify-content: center;
align-items: center;
z-index: 1;
}
<div class="main">
<div class="background"></div>
<div class="text">
<p>Flex</p>
</div>
</div>

最佳答案

<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
body {
padding: 50px;
margin: 0;
height: 1000px;
}

.main {
width: 100%;
height: 1000px;
box-sizing: border-box;
overflow: hidden;
border: 5px solid #7cb7b7;
position: relative;
display: flex;
justify-content: center;
align-items: center;
}

.image {
background-image: url('images/attractions01.jpg');
background-attachment: fixed;
background-repeat: repeat;
position: absolute;
top: -1000%;
left: -1000%;
right: -1000%;
bottom: -1000%;

}

.text {
background: white;
border: 2px solid black;
width: 200px;
height: 70px;
display: flex;
justify-content: center;
align-items: center;
z-index: 1;
}
</style>
</head>
<body>
<div class="main">
<div class="image"></div>
<div class="text">
<p>Flex</p>
</div>
</div>
</body>
</html>

关于html - 使用固定背景附件和旋转容器重复背景?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47631781/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com