Linked Questions
168 questions linked to/from How to vertically align an image inside a div
444 votes
35 answers
1.1m views
How to make an image center (vertically & horizontally) inside a bigger div [duplicate]
I have a div 200 x 200 px. I want to place a 50 x 50 px image right in the middle of the div. How can it be done? I am able to get it centered horizontally by using text-align: center for the div. ...
64 votes
3 answers
163k views
vertical-align image in div [duplicate]
i have problem with image vertical-align in div .img_thumb { float: left; height: 120px; margin-bottom: 5px; margin-left: 9px; position: relative; width: 147px; background-...
14 votes
1 answer
24k views
Vertically centering inside a div with vh [duplicate]
I'm currently trying to center an image inside a div that has it's dimensions set with vh. I tried using the display:table-cell; method which centered the image but began messing with the vw of other ...
60 votes
0 answers
130k views
How to vertical align image inside div [duplicate]
Possible Duplicate: How to properly vertically align an image Image size changes but the div size is fixed These are CSS but not working. Is it possible to achieve this without using background ...
2 votes
2 answers
11k views
Center image vertically in div using only css [duplicate]
I'm trying to center an image which is contained in a div with display set to table. In it, I wish to display an image, which should be positioned in the center, both vertically and horizontally. I ...
4 votes
2 answers
5k views
Align image in middle (vertical) of a div with css [duplicate]
I could use some help, aligning images (different sizes) at the middle of a container div. Have made a picture where you can see the div (the gray background) and that the images should align in the ...
2 votes
1 answer
9k views
Vertical align img in DIV [duplicate]
I want to vertical align an IMG in a DIV but I don't see what I'm doing wrong. It works in FF and IE7, but other browsers just align it to the top. Code can be found here: http://disgeae.nl/...
2 votes
2 answers
2k views
Horizontally and vertically center a (font-awesome) icon over an image [duplicate]
I need to overlay a microphone icon over an image (kind of watermark). Need this icon to be centered horizontally and vertically. The image may be resized depending on the browser size but the ...
0 votes
1 answer
4k views
CSS: center icon in div [duplicate]
I'm having issue with fixing icon in the middle of my div. I just want to know how to fix material-icons icon-def in div collapse menu trigger. Thank you for answering me. In jsfiddle it's working, ...
0 votes
1 answer
1k views
How can i align an image next to a div horizontally [duplicate]
I am trying to align an image with a div that contains two rows of text like this: Here is my current <div class="first-div"> <img class="img" src="/image-icon.png" /> <div class=...
0 votes
1 answer
1k views
How to center an image inside a circle [duplicate]
Can someone help and tell me how I can center an image inside the circle as show in the image below. Before writing this post I spend some time looking for an answer but I could not find out how. ...
1 vote
2 answers
1k views
horizontally align center the div with red border [duplicate]
I want to horizontally align center the div with the red border and vertically align middle the image. Vertically align middle is working but horizontally align center is not working. Here is my code: ...
0 votes
2 answers
536 views
How to center logo inside of circle? [duplicate]
I have a school project and I want to make a contact us page for my website. What I want to do is center the social media icon inside a circle. I have included a code sample below. .ul2{ display:...
0 votes
1 answer
681 views
How to center image vertically inside div element? [duplicate]
I have a question, how can I center the image inside the div? to have text on the left and image on the right. The height of this div is not set in the CSS, because I want it to increase automatically ...
2 votes
3 answers
171 views
How to vertically align image? [duplicate]
I have been trying to play around with CSS but still can't get this right. What I am trying to make: Basically, the content area is the image. div.logo-content-background { position: fixed; ...