Center elements with bootstrap templates_Portfolio page

Center elements with bootstrap templates_Portfolio page
0

#1

Hi Everybody !

I’m working on the portfolio page https://codepen.io/IkeReiko/pen/oGyMMg
and I’m stuck with a thing, I can’t center elements “About” and “Contact”.
In the section “About”, I used a div .mx-auto to nest an image with .text-center but nothing changed.
For the section “Contact” with the social media links I don’t know how to get through it too…
Your help would be so appreciated :wink:

Thanks a lot !


#2

The class text center is intended to center text inside a div tag, not images and other related elements. You’ll have to use CSS to accomplish this. This stackoverflow answer might give you an idea of what to change.


#3

Hey. You were almost there but kinda got it backwards. The issue is you’re giving a fixed width to your div which you shouldn’t be doing and the text-center class should be given to the div itself, and not the image, like so:

<div class="col-xs-12 text-center">
  <img src="http://marieglaize.com/contact/Marie_Glaize_presentation.jpg">
</div>

#4

Great ! Thanks a lot @noyb, it’s so simple and it works perfectly fine :grinning:


#5

Cool ! Thanks for this useful link :wink:


#6

Glad I could help :slight_smile: