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 8572627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:03:50+00:00 2026-06-11T19:03:50+00:00

This is my fiddle . I can’t vertically center the texts Name1 , Name2

  • 0

This is my fiddle. I can’t vertically center the texts Name1, Name2 and the time text. I did try with display: table-cell; vertical-align: middle; but it didn’t help. Can you point me where am I doing it wrong?

html:

<div style="height: 15%;">
    <div class="timeDiv">
        <span class="time">19:00</span>
    </div>

    <div class="titleDiv">
            <img src="" alt="test1 img">                        
        <span class="title">Name 1</span>
    </div>            

    <div class="titleDiv">                                        
        <img src="" alt="test2 img">
        <span class="title">Name2</span>
    </div>
</div>

css:

img{
    height: 80%; 
    float:left; 
    margin-left: 7%;
    margin-right: 1%;   
}

.timeDiv{
    float: left; 
    width:10%;
}

.titleDiv{
    float: left; 
    width: 45%;            
}

.title{
    font-size: 2em;
    float: left;
}

.time{
    font-size: 1.5em;
    float: right;
}
  • 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-11T19:03:51+00:00Added an answer on June 11, 2026 at 7:03 pm

    Have a look here 🙂 http://phrogz.net/css/vertical-align/index.html

    It explains why not to use vertical-align: middle for block level elements and shows you how to do what you want (near the bottom of the page).

    The problem here is three-fold:

    HTML layout traditionally was not designed to specify vertical behavior. By its very nature, it scales width-wise, and the content flows to an appropriate height based on the available width.

    Traditionally, horizontal sizing and layout is easy; vertical sizing
    and layout was derived from that. The reason vertical-align:middle
    isn’t doing what is desired want is because the author doesn’t
    understand what it’s supposed to do, but …

    … this is because the CSS
    specification really screwed this one up (in my
    opinion)—vertical-align is used to specify two completely different
    behaviors depending on where it is used.

    I believe method 1 will do what you want.

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

Sidebar

Related Questions

You can try it yourself in this fiddle. When you move cursor to the
On this fiddle http://jsfiddle.net/mjmitche/qVdEy/6/ , you can see that the alignment of the text
Check out this fiddle in IE9 and try resizing the browser. As you can
Referencing this Fiddle ( http://jsfiddle.net/j5uGN ), how can I toggle a clicked image's border
This isn't a javascript question but I've created a fiddle so I can demonstrate
I have this fiddle: http://jsfiddle.net/yub2B/4/ HTML: <input type=text /> <input type=text /> <input type=text
Please refer to this fiddle . While scrolling down, the table cells appear in
As illustrated in this fiddle, i can't get the customer-sidebar the one in yellow
How can I protect my background images like in this fiddle: http://jsfiddle.net/johniehjelm/eECc6/ ?
How can I make this fiddle work: http://jsfiddle.net/gAHwW/ function $escape(string) { return string.replace(/\\(\[|\]\\)/g,'\\\\$1'); }

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.