Welcome
Place Your Order
@import url('https://fonts.googleapis.com/css2?family=Cookie&display=swap');
body{
font-family: 'Cookie', cursive;
margin: 0px;
box-sizing: border-box;
}
/* navbar ________________ */
nav{
background-color: pink;
position: fixed;
z-index: 12;
width: 100%;
top: 0px;
display: flex;
justify-content: space-between;
max-height: 120px;
}
.nav-brand{
width: 100px;
display: inline-block;
}
.nav-brand img{
width: 100%;
}
nav ol{
display: flex;
gap: 5px;
margin-right: 20px
}
nav li{
display: inline-block;
list-style: none;
}
nav li a{
display: inline-block;
text-decoration: none;
color: black;
font-size: 1em;
padding:2px;
padding-top: 30px;
}
nav li a:hover{
color: white;
}
/* video greeting */
.video-greeting{
margin-top: 90px;
background-color: pink;
width: 100%;
height: 400px;
}
.video-greeting video {
width: 100%;
height: 100%;
position: relative;
object-fit: cover;
left: 50%;
transform: translateX(-50%);
}
.video-greeting a {
position: absolute;
z-index: 2;
font-size: 1em;
background-color: pink;
background-color: rgba(251, 231, 239, 1);
padding: 10px;
border-radius: 50%;
top: 43%;
left: 39%;
text-decoration: none;
color: black;
}
.cookie-tab{
background-color: pink;
padding: 20px 10px;
display: grid;
grid-template-columns: auto auto;
gap: 20px;
}
.cookie-tab img{
border: 2px black solid;
width: 100%;
display: block;
}
.cookie-tab p{
width: 100%;
display: inline-block;
text-align: center;
}
我想让这个页面更具响应性我知道我可以使用@media工具,但我想知道是否有更好的方法来改变单位类型。比如如何随着页面尺寸的增加而缩放字体,或者如何使某些元素(例如视频问候元素)不移动而停留在一个地方。谢谢
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
此代码适用于较小的设备。使用它作为起点
@media only screen and (max-width: 600px) { .nav { flex-direction: column; } }基本上样式将应用在此宽度或更小的宽度