ロゴの半分を下のdivにオーバーフローさせて、ヘッダーdivの中央にロゴを配置しようとしています。私は以下を持っていますが、どのように動的にそれを中心に設定するのか分かりません。 top
とleft
の値に頼っていると、矛盾しているようです。配置方法::背景画像の後にdivの中心に?
.header {
position: relative;
height: 200px;
background-color: #000;
&:after {
z-index: 2;
content: ' ';
position: absolute;
left: 27%;
top: 60%;
width: 200px;
height: 200px;
background-image: url('images/logo.png');
}
}