Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6333395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:27:14+00:00 2026-05-24T18:27:14+00:00

I am trying to vertically align text in my header, and am having some

  • 0

I am trying to vertically align text in my header, and am having some trouble. Attached is an image of my starting point:

Preview

The header has a set height of 141px and everything in that header should be right in the middle. Even the “Name of Website Here”, so if that name changes and only takes up 1 line, or maybe 3 lines it will all be in the same place.

Note: this is for multiple websites, which are being generated dynamically so that’s why I cannot just position it with a margin-top because the names will be different, some might take up a few lines and some might take up multiple lines.


I took out my attempts to vertically align it from what I searched online because nothing is working so this is the code from my starting point.

HTML:

<div id="header">
    <h1>Name of Website Here</h1>
    <h3>Call Today!<br /><span>(xxx) xxx-xxxx</span></h3>
    <p>123 Main St.<br />City, State, Zip</p>
</div>

CSS:

#header{height:141px;}
#header h1{float:left;font-size:1.7em;width:200px;text-align:center;line-height:26px}
#header h3{float:left;text-align:center;color:#e62520;font-size:1.7em;line-height:26px;font-style:italic;margin:0 0 0 95px}
#header h3 span{font-size:1.2em;}
#header p{float:right;color:#2a5091;font-size:1.3em;font-style:italic;font-weight:bold;line-height:20px;text-align:right;}

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T18:27:15+00:00Added an answer on May 24, 2026 at 6:27 pm

    I think this is what you are looking for, see demo fiddle.

    The markup will become like:

    <div id="header">
        <span><h1>Name of Website Here</h1></span>
        <span><h3>Call Today!<br /><span>(xxx) xxx-xxxx</span></h3></span>
        <div><span><p>123 Main St.<br />City, State, Zip</p></span></div>
    </div>
    

    Maybe you can fiddle around some more to eliminate one or two tags.

    Tested on Win7 in IE8, IE9, Opera 11.50, Safari 5.0.5, FF 5.0, Chrome 12.0. I know it is also possible to work in IE7, but it needs some tuning. T.b.c.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to align some text of different sizes vertically, however, Firefox displays the
I am trying to vertically align to the middle both an image and some
I am trying to align label text vertically aligned for my iPhone application Timer.
I am trying to place some text over a button image. I manage to
I am trying to vertically align text in IE7 is proving to be a
I'm having some CSS trouble when trying to get IE's display the same as
I'm trying to make an asterisk line up vertically with surrounding text/graphics rather than
I gave up on trying to center an image vertically and horizontally. I seen
I am trying to make text float in the middle vertically. This means there
I am trying to create a full width background image that aligns vertically with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.