WordPress.org

Ready to get started?Download WordPress

Forums

I can't get vertical-align:middle to work (3 posts)

  1. Pete
    Member
    Posted 1 year ago #

    I can't get the "Something goes here to align vertically in the middle... Any help greatly appreciated.

    h2.banner a{
    	vertical-align:middle;
    	font-family: 'Oswald', Impact, Georgia, Times New Roman;
    	padding:0px 0px 0px 0px;
    	color:#555;
    	line-height:30px;
    	height:100px;
    	text-align:center;
    	margin: 0px 0px 0px 0px;
    	font-size:25px;
    	}
    <div class="adblock">
    
    <img src="xxxxxx.jpg" class="attachment-banner wp-post-image" alt="xxxxxx" title="xxxxxxx" width="100" height="100">	
    
    <h2 class="banner"><a href="xxxxxxx" title="xxxxxxxx">Something goes here</a></h2>
    
    <div class="clear"></div>
    </div>
  2. Andrew Nevins
    Spam zapper & Volunteer Moderator
    Posted 1 year ago #

    That code works for me.
    I've tested by adding a red border around the <h2>, then adding line-height to something more noticeable like 100px. The anchor does vertically align in the middle of the <h2>

  3. Pete
    Member
    Posted 1 year ago #

    Thanks, i'll have another look at it

Topic Closed

This topic has been closed to new replies.

About this Topic