I need to center an img (the one with class=“key”, but floated elements prevent it. What technique should I use for centering it?
Thanks!
GitHub repo: https://github.com/CalogerN/beta-sign-up-split-layout
Live preview: https://calogern.github.io/beta-sign-up-split-layout/
body {
margin: 0px;
padding: 0px;
font-size: 16px;
}
header {
background-image: url(../img/bg-intro.svg);
background-size: cover;
background-position: center;
background-repeat: no-repeat;
height: 643px;
}
.logo {
float: left;
}
.wlogo {
fill: white;
}
.key {
height: 234px;
position: relative;
top: 200px;
}
.key-wrapper {
display: block;
margin: auto;
}
<section class="section-a">
<header>
<svg width="120" height="35" class="logo" *numbers* </svg>
<div class="key-wrapper">
<img src="img/illustration-main.svg" alt="a man with a key" class="key">
</div>
</header>