I have the following simple HTML
and CSS
:
.profile {
width: 80%;
margin-top: 15vh;
margin-left: 10%;
display: flex;
float: left;
box-sizing: border-box;
border-style: solid;
border-width: 1px;
background-color: green;
}
.profile_picture {
float: left;
width: 100%;
height: 70%;
box-sizing: border-box;
border-style: solid;
border-width: 1px;
}
.profile_picture img {
height: 100%;
width: 100%;
box-sizing: border-box;
border-style: solid;
border-width: 1px;
}
.profile_discription {
padding: 1%;
float: left;
}
<div class="profile">
<div class="profile_picture">
<img src="http://placehold.it/450x150">
</div>
<div class="profile_description">
<p> Description goes here. </p>
</div>
<div>
The code displays a website with a profile consisting of a picture and a description.
You can also find the code in the jsfiddle
here.
All this works fine so far.
However, the problem is that once I us the display: flex;
property in the class .profile
the picture is shown in different sizes depending if I use Edge, Firefox or Chrome.
Do you have any idea how I can avoid the different sizes of the picture and still be able to use the display:flex;
property?