My React Code
export default function Card(props) {
return (
<div className="card">
<img src={`images/${props.location}.jpg`} alt="Location" className="card--image" />
<div className="card--stats">
<div className="google-location">
<a href={props.googleMapsUrl}><GoLocation /></a>
<p>{props.location} View on Google Maps</p>
</div>
<h2>{props.title}</h2>
<strong>{props.startDate} - {props.endDate}</strong>
<p className="desc">{props.description}</p>
</div>
</div>
)
My CSS Code
.card{
margin-top: 55px;
margin-left: 40px;
display: flex;
}
.card--image{
width:125px;
height:168px;
object-fit: cover;
border-radius: 5px;
display: inline-block;
}
.card--stats{
display: inline-block;
}
desc{
position: absolute;
width: 326px;
height: 45px;
left: 184px;
top: 203px;
}
.google-location{
display: inline;
}
The location icon and the location name are supposed to come side by side, but it is not working, and I can’t figure out why.
This is how they look now