私は問題があります。HTMLページがあり、画像と詳細を画像の上にオーバーレイとして表示しています。そのために、次のコードがあります。
.grid-pagina {
width: 80%;
margin: auto auto;
display: grid;
grid-template-columns: 45% auto;
column-gap: 20px;
padding-top: 30px;
}
.leftside {
width: 100%;
height: 90%;
text-align: left;
}
.rightside {
width: 50%;
height: 90%;
font-family: 'Roboto', sans-serif;
}
.country {
top: 25px;
right: 25px;
position: absolute;
}
.country img {
border-radius: 32px;
height: 64px;
width: 64px;
}
.title {
font-size: 35px;
margin-bottom: 10px;
font-family: 'Roboto', sans-serif;
color: red;
}
.image-container {
position: relative;
width: 100%;
display: inline-block;
background-color: blue;
}
.coverimage {
border-radius: 30px;
position: absolute;
top: 0;
left: 0;
width: 100%;
min-width: 100%;
min-height: 100%;
}
.activity-container {
position: absolute;
top: 0;
}
.activity {
display: flex;
align-content: center;
justify-content: center;
color: red;
font-size: 20px;
}
.activity img {
height: 50px;
}
.activity span {
padding-left: 10px;
margin: auto auto;
}
.user-info {
position: absolute;
bottom: 0;
left: 0;
background-color:red;
vertical-align: bottom
}
.user-info .user-name {
font-size: 30px;
padding: 10px;
font-weight: bold;
color: white;
}
.user-info .user-details {
font-size: 20px;
padding: 10px;
color: white;
}
.smalltitle {
font-size: 25px;
margin-top: 30px;
color: red;
}
.hobbysmall img {
height: 20px;
}
.hobbysmall {
padding-right: 40px;
display: inline-block;
}
.taalicon {
height: 50px;
width: 75px;
padding-left: 15px;
display: inline-block;
margin-top: 30px;
}
.taalicon img {
height: 100%;
width: 100%;
}
.talen {
display: inline-flex;
}
.bio p {
width: 450px;
overflow: hidden;
height: 200px;
line-height: 20px;
word-wrap: break-word;
padding-top: 20px;
}
.declinebutton {
position: relative;
margin-left: 15%;
}
.acceptbutton {
margin-top: -20px;
position: relative;
margin-left: 5%;
}
.interesses {
margin-top: 20px;
}
.bigbutton img {
height: 100px;
padding-top: 70px;
}
<div class="grid-pagina">
<div class="leftside">
<div class="title">
Noorwegen
</div>
<div class="image-container">
<img src="https://static.rondreis.nl/rondreis-storage-production/bezienswaardigheden-69-rome-jpg/1024x686/cover/eyJidWNrZXQiOiJyb25kcmVpcy1zdG9yYWdlLXByb2R1Y3Rpb24iLCJrZXkiOiJiZXppZW5zd2FhcmRpZ2hlZGVuXC82OVwvcm9tZS5qcGciLCJlZGl0cyI6eyJyZXNpemUiOnsid2lkdGgiOjEwMjQsImhlaWdodCI6Njg2LCJmaXQiOiJjb3ZlciJ9fX0=" class="coverimage"/>
<div class="activity-container">
<div class="activity">
<img src="img/page/match_profiel/sun.png"> <span>Zonnig</span>
</div>
<div class="activity">
<img src="img/page/match_profiel/icon_boat_red.png"> <span>Zonnig</span>
</div>
<div class="activity">
<img src="img/page/match_profiel/icon_climb.png"> <span>Zonnig</span>
</div>
</div>
<div class="country">
<img src="img/flag/dutch.png">
</div>
<div class="user-info">
<div class="user-name">
Tim, 26 jaar
</div>
<div class="user-details">
Man, 2000-3000
</div>
</div>
</div>
</div>
<div class="rightside">
<div class="smalltitle">
Interesses
</div>
<div class="interesses">
<div class="hobbysmall">
<img src="img/page/match_profiel/icon_tag.png"> Boten
</div>
<div class="hobbysmall">
<img src="img/page/match_profiel/icon_tag.png"> Boten
</div>
<div class="hobbysmall">
<img src="img/page/match_profiel/icon_tag.png"> Boten
</div>
</div>
<div class="talen">
<div class="smalltitle">Taal(en)</div>
<div class="taalicon">
<img src="img/flag/dutch.png">
</div>
<div class="taalicon">
<img src="img/flag/france.png">
</div>
</div>
<div class="smalltitle">
Over
</div>
<div class="bio">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type
and scrambled it to make a type specimen book. It has survived not only five centuries, but also the
leap into electronic typesetting, remaining essentially unchanged. </p>
</div>
</div>
</div>
問題は、画像の左下にuser-infoを含むdivが必要なことです。使ったらそこに行くと思っていたのですがbottom: 0;
、それで押し上げられます。
私は何が間違っているのですか?
.image-container
画像サイズはどのくらい知っていないと、それは持っていないheight: 100%
としても。最初のルールも忘れないでください:
html, body {
height: 100%;
}
.grid-pagina {
width: 80%;
margin: auto auto;
display: grid;
grid-template-columns: 45% auto;
column-gap: 20px;
padding-top: 30px;
}
.leftside {
width: 100%;
height: 90%;
text-align: left;
}
.rightside {
width: 50%;
height: 90%;
font-family: 'Roboto', sans-serif;
}
.country {
top: 25px;
right: 25px;
position: absolute;
}
.country img {
border-radius: 32px;
height: 64px;
width: 64px;
}
.title {
font-size: 35px;
margin-bottom: 10px;
font-family: 'Roboto', sans-serif;
color: red;
}
.image-container {
position: relative;
width: 100%;
display: inline-block;
background-color: blue;
}
.coverimage {
border-radius: 30px;
top: 0;
left: 0;
width: 100%;
min-width: 100%;
min-height: 100%;
}
.activity-container {
position: absolute;
top: 0;
}
.activity {
display: flex;
align-content: center;
justify-content: center;
color: red;
font-size: 20px;
}
.activity img {
height: 50px;
}
.activity span {
padding-left: 10px;
margin: auto auto;
}
.user-info {
position: absolute;
bottom: 0;
left: 0;
background-color:red;
vertical-align: bottom
}
.user-info .user-name {
font-size: 30px;
padding: 10px;
font-weight: bold;
color: white;
}
.user-info .user-details {
font-size: 20px;
padding: 10px;
color: white;
}
.smalltitle {
font-size: 25px;
margin-top: 30px;
color: red;
}
.hobbysmall img {
height: 20px;
}
.hobbysmall {
padding-right: 40px;
display: inline-block;
}
.taalicon {
height: 50px;
width: 75px;
padding-left: 15px;
display: inline-block;
margin-top: 30px;
}
.taalicon img {
height: 100%;
width: 100%;
}
.talen {
display: inline-flex;
}
.bio p {
width: 450px;
overflow: hidden;
height: 200px;
line-height: 20px;
word-wrap: break-word;
padding-top: 20px;
}
.declinebutton {
position: relative;
margin-left: 15%;
}
.acceptbutton {
margin-top: -20px;
position: relative;
margin-left: 5%;
}
.interesses {
margin-top: 20px;
}
.bigbutton img {
height: 100px;
padding-top: 70px;
}
<div class="grid-pagina">
<div class="leftside">
<div class="title">
Noorwegen
</div>
<div class="image-container">
<img src="https://static.rondreis.nl/rondreis-storage-production/bezienswaardigheden-69-rome-jpg/1024x686/cover/eyJidWNrZXQiOiJyb25kcmVpcy1zdG9yYWdlLXByb2R1Y3Rpb24iLCJrZXkiOiJiZXppZW5zd2FhcmRpZ2hlZGVuXC82OVwvcm9tZS5qcGciLCJlZGl0cyI6eyJyZXNpemUiOnsid2lkdGgiOjEwMjQsImhlaWdodCI6Njg2LCJmaXQiOiJjb3ZlciJ9fX0=" class="coverimage"/>
<div class="activity-container">
<div class="activity">
<img src="img/page/match_profiel/sun.png"> <span>Zonnig</span>
</div>
<div class="activity">
<img src="img/page/match_profiel/icon_boat_red.png"> <span>Zonnig</span>
</div>
<div class="activity">
<img src="img/page/match_profiel/icon_climb.png"> <span>Zonnig</span>
</div>
</div>
<div class="country">
<img src="img/flag/dutch.png">
</div>
<div class="user-info">
<div class="user-name">
Tim, 26 jaar
</div>
<div class="user-details">
Man, 2000-3000
</div>
</div>
</div>
</div>
<div class="rightside">
<div class="smalltitle">
Interesses
</div>
<div class="interesses">
<div class="hobbysmall">
<img src="img/page/match_profiel/icon_tag.png"> Boten
</div>
<div class="hobbysmall">
<img src="img/page/match_profiel/icon_tag.png"> Boten
</div>
<div class="hobbysmall">
<img src="img/page/match_profiel/icon_tag.png"> Boten
</div>
</div>
<div class="talen">
<div class="smalltitle">Taal(en)</div>
<div class="taalicon">
<img src="img/flag/dutch.png">
</div>
<div class="taalicon">
<img src="img/flag/france.png">
</div>
</div>
<div class="smalltitle">
Over
</div>
<div class="bio">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type
and scrambled it to make a type specimen book. It has survived not only five centuries, but also the
leap into electronic typesetting, remaining essentially unchanged. </p>
</div>
</div>
</div>
プレビュー
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加