我正在为我的大学项目设计一个标题,其中标志应该位于左上角。我尝试使用CSS中的浮动属性,但没有反应。如何将我的标志移到标题栏的左上角?我试了很多次,但代码没有执行。
@import url('https://fonts.googleapis.com/css2?family=Montserrat+Alternates:ital,wght@0,500;1,400&display=swap')
* {
box-sizing: border-box;
margin: 0;
padding: 0;
background-color: #F5F5F5;
}
li,
a,
button {
font-family: "Montserrat", sans-serif;
font-weight: 500;
font-size: 16px;
color: #000000;
text-decoration: none;
}
header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30px 10%;
background: linear-gradient(rgba(165, 246, 144, 0.3) 0%, rgba(158, 249, 216, 0.63) 100%);
height: 56px;
}
p {
position: absolute;
width: 584px;
height: 67px;
left: 232px;
top: 25px;
text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
background: url(pharmapp.png);
align-items: center;
font-family: 'Montserrat';
font-style: italic;
font-weight: 400;
font-size: 16px;
line-height: 34px;
color: #000000;
}
.logo {
position: relative;
float: left;
margin-block-start: 10px;
background: url(pharmapp.png);
height: 122px;
left: 20px;
top: 0px;
bottom: 40px;
}
![]()
Medcines on your Doorstep
Contact
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号