• Resolved sirtues

    (@sirtues)


    trying to center the caption that appears on the front page so that it is always vertically centered on the page. problem is I cannot find where the code is coming from because of all the wordpress functions.. tried doing it in css, but I think I need access to the code (if I can ever find it) to add a span or some such.

    any help or ideas?? ThaNKYOU!

    https://www.miriamhyman.com

Viewing 13 replies - 1 through 13 (of 13 total)
  • This should get you started – but you need to do something about the text below the h2 element

    #wrapper {
    height: 100%;
    }
    
    #slidecaption {
    height: 100%;
    
    }
    #gallery_caption {
    display: table;
    height: 100%;
    
    }
    
    #gallery_caption h2 {
    display: table-cell;
      vertical-align: middle;
    width: 100%;
    clear: right;
    }
    Thread Starter sirtues

    (@sirtues)

    thanks, but, unfortunately, that did not work…

    grrr.. why is it so hard?? ??

    ok firstly you have a number of invalid css declarations:

    #wrapper {
    height: 100% width: 100%;
    }

    instead of

    #wrapper {
    height: 100%;
    width: 100%;
    }
    #gallery_caption h2 {
    text-align: middle !important;
    }

    instead of

    #gallery_caption h2 {
    text-align: center !important;
    }

    and vertical-align: middle is missing from h2…. should be

    #gallery_caption h2 {
    display: table-cell;
      vertical-align: middle;
    width: 100%;
    clear: right;
    }
    Thread Starter sirtues

    (@sirtues)

    oops, my bad.

    okay,those changes are made (I removed text-align-center as I wanted left-align)..

    any other ideas?

    you need to make sure you closed off the properies correctly as you have ended up with

    #gallery_caption h2 {
    font-size: 44pt !important;
    line-height: 120% !important;
    color: #fff;
    font-weight: 500;
    font-family: 'helvetica neue', Helvetica, Arial, sans-serif;
    text-shadow: 1px 1px 1px black;
    display: table-cell;
    vertical-align: middle width: 100%;
    clear: right;
    }

    notice the

    vertical-align: middle width: 100%;

    which should be

    vertical-align: middle;
    width: 100%;

    Thread Starter sirtues

    (@sirtues)

    amazing! thank you!

    now, just need to figure out how to get the rest of it underneath on one line..

    I suggest you put is as part of the h2 and wrap it around a span

    <span>The Queen, Cymbeline. Actors Brian Wiles and Lucas Dixon. Photo Credit T. Charles Erickson</span>

    so you end up with

    <h2>”Miriam A. Hyman, all dressed-up for evil and deliciously duplicitous as The Queen.” <span>The Queen, Cymbeline. Actors Brian Wiles and Lucas Dixon. Photo Credit T. Charles Erickson</span></h2>

    then the css

    #gallery_caption h2 span {
    font-size: 15px;
    font-style: normal;
    font-weight: 500;
    letter-spacing: 1px;
    line-height: 22px;
    clear: left;
    display: block;
    }
    Thread Starter sirtues

    (@sirtues)

    okay.. one final question,

    the code (which I found!) looks like this:

    <?php $homeslides .= ‘{image : \”.$image_url[0].’\’, thumb: \”.$small_image_url[0].’\’, title: \'<div id=”gallery_caption”><h2>’.htmlentities($photo->post_title, ENT_QUOTES).'</h2>’
    .htmlentities($photo->post_content, ENT_QUOTES).'</div>\’},’; ?>
    <?php
    }

    any idea how I can put a <span> tag in there?

    You are typing in the h2 in an editor right? so you could just add the title in editor as

    “Miriam A. Hyman, all dressed-up for evil and deliciously duplicitous as The Queen.” <span>The Queen, Cymbeline. Actors Brian Wiles and Lucas Dixon. Photo Credit T. Charles Erickson</span>

    otherwise this should work

    <?php $homeslides .= '{image : \''.$image_url[0].'\', thumb: \''.$small_image_url[0].'\', title: \'<div id="gallery_caption"><h2>'.htmlentities($photo->post_title, ENT_QUOTES).'<span>'
    .htmlentities($photo->post_content, ENT_QUOTES).'</span></h2></div>\'},'; ?>
    <?php
    }
    Thread Starter sirtues

    (@sirtues)

    you are a God among men! Thankyou!!

    :-} you’re welcome… don’t forget to mark it as resolved

    Thread Starter sirtues

    (@sirtues)

    resolved!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘center text vertically’ is closed to new replies.