- Joined
- Mar 27, 2023
- Messages
- 1
- Reaction score
- 0
Hi all...
Thank you for reading this...I'm in need of some help as I'm pulling my hair out lol...I've created a html webpage page called 'Gallery' where I'd like to show off images of 3d models I've created. I've coded the flip-card part with no issues, but as soon as I put on a locally saved (in the root folder) image it goes array. The image will not fit the card. Its either too small and you can see the card front as well as the image, or its too big and actually increases the card size too? I've tried various methods of resizing the image both in the html with width="" height="" etc but it does nothing, I've used a resizing website to resize the image to lots of different px like 350 x 300 etc but again it does nothing? I've copied my codes below, I'm using external CSS.
CSS is :-
#card-holder {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
}
.flip-card {
background-color: transparent;
width: 16.80em;
height: 16.80em;
margin: 1em;
perspective: 62.5em;
}
.flip-card-inner {
position: relative;
width: 100%;
height: 100%;
text-align: center;
transition: transform 2.6s;
transform-style: preserve-3d;
box-shadow: 0 0 1em rgba( 0, 0, 0, 0.8 );
}
.flip-card:hover .flip-card-inner,
.flip-card:active .flip-card-inner {
transform: rotateY( 180deg );
}
.flip-card-front, .flip-card-back {
position: absolute;
width: 100%;
height: 100%;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
.flip-card-front {
background-color: #bbb;
color: #000;
}
.flip-card-back {
background-color: #2980b9;
color: #fff;
transform: rotateY( 180deg );
}
.flip-card img {
display: block;
width: 100%;
height: auto;
border: 1px solid #000;
}
HTML is :-
<!DOCTYPE html>
<html lang="en" class="pc js js">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1">
<title>Gallery Page</title>
<link rel="stylesheet" href="St3le.css" media="screen" type="text/css">
</head>
<body>
<a href="Home.html" Alt="Back"><img src="Logo1.jpeg" alt="Logo" width="350" height="250" id="thelogo" class="center"/></a>
<div id="card-holder">
<div class="flip-card">
<div class="flip-card-inner">
<div class="flip-card-front">
<img src="" alt=""/>
</div>
<div class="flip-card-back">
<h1 class="ha1"></h1>
<p class="p1"></p>
</div>
</div>
<!-- .flip-card --></div>
<!-- #card-holder --></div>
</body>
</html>
Thx Ed.
Thank you for reading this...I'm in need of some help as I'm pulling my hair out lol...I've created a html webpage page called 'Gallery' where I'd like to show off images of 3d models I've created. I've coded the flip-card part with no issues, but as soon as I put on a locally saved (in the root folder) image it goes array. The image will not fit the card. Its either too small and you can see the card front as well as the image, or its too big and actually increases the card size too? I've tried various methods of resizing the image both in the html with width="" height="" etc but it does nothing, I've used a resizing website to resize the image to lots of different px like 350 x 300 etc but again it does nothing? I've copied my codes below, I'm using external CSS.
CSS is :-
#card-holder {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
}
.flip-card {
background-color: transparent;
width: 16.80em;
height: 16.80em;
margin: 1em;
perspective: 62.5em;
}
.flip-card-inner {
position: relative;
width: 100%;
height: 100%;
text-align: center;
transition: transform 2.6s;
transform-style: preserve-3d;
box-shadow: 0 0 1em rgba( 0, 0, 0, 0.8 );
}
.flip-card:hover .flip-card-inner,
.flip-card:active .flip-card-inner {
transform: rotateY( 180deg );
}
.flip-card-front, .flip-card-back {
position: absolute;
width: 100%;
height: 100%;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
.flip-card-front {
background-color: #bbb;
color: #000;
}
.flip-card-back {
background-color: #2980b9;
color: #fff;
transform: rotateY( 180deg );
}
.flip-card img {
display: block;
width: 100%;
height: auto;
border: 1px solid #000;
}
HTML is :-
<!DOCTYPE html>
<html lang="en" class="pc js js">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1">
<title>Gallery Page</title>
<link rel="stylesheet" href="St3le.css" media="screen" type="text/css">
</head>
<body>
<a href="Home.html" Alt="Back"><img src="Logo1.jpeg" alt="Logo" width="350" height="250" id="thelogo" class="center"/></a>
<div id="card-holder">
<div class="flip-card">
<div class="flip-card-inner">
<div class="flip-card-front">
<img src="" alt=""/>
</div>
<div class="flip-card-back">
<h1 class="ha1"></h1>
<p class="p1"></p>
</div>
</div>
<!-- .flip-card --></div>
<!-- #card-holder --></div>
</body>
</html>
Thx Ed.