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

  • Home
  • SEARCH
  • 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 7929897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:14:24+00:00 2026-06-03T20:14:24+00:00

I have a div where I need to align text in a vertical fashion

  • 0

I have a div where I need to align text in a vertical fashion like in a list (ul/li). I’ve tried lists, table cells, paragraphs and a few other things with no success. Most of my attempts caused the results to be outside of my containing divs – .header and .headerright.

Here’s my stripped down code:

HTML :

<div class="header">
    <div class="headerleft">
    </div>
    <div class="headerright">
            Line 1 Text
            Line 2
    </div>
</div>

CSS :

div.header {
    height:75px;
    background-color:#FFF;
    padding-left:10px;
    padding-right: 10px;
}
    div.headerleft {
    border: none;
    float: left;
    margin: 0;
    padding: 0;
    line-height: 75px;
}

div.headerright {
    border: none;
    float: right;
    margin: 0;
    padding: 0;
    line-height: 75px;
}

What I need is the text “Line 1 Text” and “Line 2” to appear like in a list with “Line 2” appearing under “Line 1 Text”. This block of text should be centered in the containing div and “Line 2” should be centered under “Line 1 Text” like here:

Line 1 Text
   Line 2

The only browser I’m concerned about is IE9. How can this be done? I’m stumped.

  • 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-06-03T20:14:26+00:00Added an answer on June 3, 2026 at 8:14 pm

    Put your text inside span elements. It works for me.

    CSS :

    div.headerright {
        border: none;
        float: right;
        margin: 0;
        padding: 0;
    }
    
    /* css rule to display span elements.  */
    span{
        display:block;
    }
    

    HTML :

    <div class="header">
        <div class="headerleft">
        </div>
        <div class="headerright">
            <span>Line 1 Text</span>
            <span>Line 2</span>
        </div>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have text like this div bla-bla end div i need to get only
I have the following: CSS: .photo { overflow: hidden; display: table-cell; vertical-align: middle; text-align:
I have a div in which I need a permanent vertical scrollbar. Sometimes the
I have input text: <div><label wicket:for=name>Name</label><input type=text wicket:id=name /></div> Now I need to add
I have a table header, <th> , that contains a <div> with text. I
I have this nightmare of code, <div style=height:46px;> <div style=text-align:left;float:left;> <img alt=Document Logo src=Images/img1.gif></img>
I have two <div> elements inside a container <div> and I need to align
I have a piece of text which i need to align in the middle
I have a styled div where I need to add a long text. I
Let's say you have the following HTML: <html> <div style=text-align: center;> <img src=http://www.ps.uci.edu/~tomba/ants/sugar.jpg width=50

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.