M
M
Maxim Golovlev2021-07-11 12:02:24
css
Maxim Golovlev, 2021-07-11 12:02:24

Why is positioning not working?

Good afternoon!

HTML:

<div class="social">
    <div class="logo"></div>
    <div class="content">
        <div class="title"><h1></h1></div>
        <div class="text"><h2></h2></div>
    </div>
</div>


CSS:
.social {
    width: 443px;
    height: 153px;
    margin: 0 auto;
    background-image: url(image/socialbackground.png)
}

.logo {
    width: 90px;
    height: 90px;
    padding-top: 30px;
    padding-bottom: 30px;
    padding-left: 44px;
    background-image: url(image/twitchicon.png);
    background-repeat: no-repeat;
}


It turns out:
60eab384ef9cc929073563.png

It should turn out:
60eab39af31ab559703278.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Localhost, 2021-07-11
@golovlevarts

.social {
    width: 443px;
    height: 153px;
    margin: 0 auto;
   padding: 2em;
    background-image: url(image/socialbackground.png);
display:flex;
}
.logo {
    width: 40%;
    height: 90px;
    background-image: url(image/twitchicon.png);
    background-repeat: no-repeat;
   background-size: cover;
background-position: center;
margin:0 15px 0 0
}
. content{
   width: 60%;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question