Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] Centering not working properly in some browsers

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #207779
    Max
    Participant

    My site here: http://pitfarmtennis.co.uk/cms/ fails to center elements properly in some browsers, for example:

    Chrome: Works
    Safari 8: Doesn’t work
    Safari 9: Works
    Safari iPad: Doesn’t work
    Samsung Galaxy tablet: Doesn’t work
    Below are some images of it working and not working – any ideas of why this is please? My understanding was that I has implemented a cross-browser solution for centring, supporting even ie8!

    Images: http://1drv.ms/1LPj8be

    Here is how I am currently centering items:

    .home-section-1 {
    height: 600px;
    position: relative;
    }

    .home-section-1-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    @include no_select;
    width: 99%;
    }

    Thanks for your help!

    #208391
    Max
    Participant

    @Shikkediel that is really great, thank you. Does anybody know an ie8 fallback please?

    #208394
    Max
    Participant

    Hi @Beverleyh thanks for the reply – much appreciated. Sadly however the site features many elements with heights and widths as %s – which I guess this wouldn’t work for.

    Many thanks for you help.

    #208515
    Max
    Participant

    Thanks for the reply @Shikkediel – I like that example. Anything for relatively positioned elements please (that is cross browser inc. ie8?)

    Many thanks

    #208545
    Max
    Participant

    That’s great info thanks very much guys :))

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.