#align img to center of div (vertically)

18 messages · Page 1 of 1 (latest)

bitter shale
#

i tried ```css
.socialLink {
display: flex;
width: 30px;
height: 30px;
justify-content: center;
}

#

ig justify-content dosent do what i thought it did, or im doing it wrong

bitter shale
#

does the order i set the properties in matter?

bitter shale
#

also this makes my picture zoom in, goes back to the original size im pretty sure

#

o alr

#

yeah i have changed it a little bit since then 2 sec

#
.topBar {
    padding: 20px;
}

.socialLinks {
    position: absolute;
    right: 25px;
    top: 25px;
}

.socialLink {
    display: flex;
    width: 30px;
    height: 30px;
}
        <div class="topBar">

            <img src="./img/logo.png" id="logo">

            <div class="socialLinks">
    
                <a class="socialLink" href="#">
                    <img src="./img/instagram-logo.svg">
                </a>
    
            </div>

        </div>
bitter shale
#

i cannot upload the logo but i can for the ig logo

night pewterBOT
#

@bitter shale

File Attachments Not Allowed

For safety reasons we do not allow file and video attachments.

Code Formatting

You can share your code using triple backticks like this:
```
YOUR CODE
```

Large Portions of Code

For longer scripts use Hastebin or GitHub Gists and share the link here

Ignored these files
  • instagram-logo.svg
#

@bitter shale

tesco noob coder (ping on reply) Uploaded Some Code
Uploaded these files to a Gist
bitter shale
#

1080x1080 iirc

#

it's a square

bitter shale
#

alr i will try it ina sec

#

also why did you replace 30px i think it was, with 1.875em? whats the difference?

bitter shale
#

ohhh alr

#

thanks

bitter shale
#

i used to do that but in a few code examples i saw people using camel-case (topBar/socialLink) so i decided to do it