Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link images don't get centered #4708

Closed
xDaizu opened this issue Nov 4, 2016 · 7 comments
Closed

Link images don't get centered #4708

xDaizu opened this issue Nov 4, 2016 · 7 comments

Comments

@xDaizu
Copy link

xDaizu commented Nov 4, 2016

 <div class="ui vertical segment">
     <p>
          blablablabla
     </p>
         <img class="ui small centered image" alt='Disponible en Google Play' src='https://play.google.com/intl/en_us/badges/images/generic/es_badge_web_generic.png'/>
         <a class="ui small centered image" href=''>
                 <img alt='Disponible en Google Play' src='https://play.google.com/intl/en_us/badges/images/generi/es_badge_web_generic.png'/>
         </a>
 </div>

First image gets centered, second one (the ) doesn't.

EDIT: Added Jsfiddle https://jsfiddle.net/n8u8he15/

@saitonakamura
Copy link

Can you create a jsfiddle illustrating the problem?

@seakrebel
Copy link

seakrebel commented Nov 6, 2016

It's pretty obvious that you didn't assign those classes to same kind of elements so that's probably why you aren't getting the same result.
<img class="ui small centered image"
(...)
<a class="ui small centered image" href=''>

Check your code again :)

@xDaizu
Copy link
Author

xDaizu commented Nov 9, 2016

@mihokovic Yeah, I know they are different elements. Using the classes .ui.image with elements is reflected in the documentation.

Since that's how it's defined in the documentation it should either behave the same way (it does with other variations like size or circular) or make a explicit note that this specific variation (centered) is not appliable to link images.

https://jsfiddle.net/n8u8he15/

@saitonakamura
Copy link

<a> and <img> tags has display: inline by default
But semantic overrides this for an image to block, to make margin: 0 auto work

img.ui.image {
    display: block;
}

So as a workaround I suggest hack the css or inline style to display: block
https://jsfiddle.net/0ch9yxs1/

@xDaizu
Copy link
Author

xDaizu commented Nov 9, 2016

@saitonakamura thanks, now I put it up for debate if either:

a) include this fix (we should check for other undesired interactions)

a.ui.image.centered{
    display: block;
}

b) include in the documentation a note about the centered variation not working with the type "link images"

I think one of those should be executed.

@stale
Copy link

stale bot commented Feb 23, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

@lubber-de

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants