Forums

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

Home Forums CSS Can you solve this challenge?

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #34584
    Brightonmike
    Member

    http://beta.jetbookingdirect.com/?page_id=130

    How do I get the text inside each div slide to be centre aligned relative to the browser window?

    Absolute positioning does not work.

    Ideas?

    #88270
    Josh
    Member

    I was able to get this http://postimage.org/image/alii8p50/

    This is how i did it…

    ul#securityslide li h2 {
    font-family: 'Dancing Script', cursive;
    padding:45px;
    color:#fff;
    font-size:60px;
    width: 100%;
    text-align: center;
    }

    …AND…

    ul#securityslide li p {
    padding:45px;
    color:#fff;
    font-size:17px;
    text-align:left;
    width:600px;
    display: block;
    margin-left: 450px;
    }

    Hope this helps.

    #88382
    Brightonmike
    Member

    That doesn’t work.

    You’re centering the text within the slider, but not within the window.

    I think this needs javascript.

    #88344
    Brightonmike
    Member

    jQuery seems to be the best idea here.

    $(function() {
    if($(document).width() <= $(window).width()) {
    $('h2').css({ 'width': ($(window).width()) });
    $(window).resize(function(){
    $('h2').css({ 'width': ($(window).width()) });
    });
    }
    });
    #88257
    rtmedia
    Member

    remove text-align: center; from ul#securityslide li h2 {

    and that’s all you need to do

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