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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:27:13+00:00 2026-06-04T19:27:13+00:00

See this fiddle . When I take out the text, the spans line up

  • 0

See this fiddle. When I take out the text, the spans line up next to each other nicely. When I add text to one, it appears lower in the page.

<div>
    <span id="first">
    </span>
    <span id="second">
        Text
    </span>
</div>

span#first {
    display:inline-block;
    width: 100px;
    height: 100px;
    background-color: red;    
}

span#second {
    display: inline-block;
    width: 100px;
    height: 100px;
    background-color: yellow;   
}
  • 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-04T19:27:16+00:00Added an answer on June 4, 2026 at 7:27 pm

    The default value of vertical-align is baseline. The CSS spec says that for vertical-align: baseline

    Align the baseline of the box with the baseline of the parent box. If the box doesn’t have a baseline, align the bottom of the box with the parent’s baseline.

    An empty block has no baseline, so the bottom of the span lines up with the baseline of the parent div. The next span, since it has text (and therefore a baseline), lines up the text with the baseline of the div.

    If you set vertical-align: top on both span elements, they should line up correctly.

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

Sidebar

Related Questions

Please see this fiddle (the result window should be made large). When one of
If you take a look at this fiddle in Chrome: http://jsfiddle.net/up4Fa/ You will see
Please take a look at this fiddle: http://jsfiddle.net/hughbe/QYGcq/ As you can see, the label
See this fiddle in Firefox http://jsfiddle.net/qwbpZ/4/ On hover you will see this grey line
Please see this fiddle I want the scrolling div stop following when left div
Fiddle me this: http://jsfiddle.net/TrySpace/QZMP6/17/ After editing the input field, the html updates on each
See this fiddle: http://jsfiddle.net/uqJHf/ I have set the first column to show up with
Please see this fiddle for my situation. Essentially, I have a floating span which
This is my code (please see this fiddle ): HTML <div id=container> <span id=left>Left
See this fiddle: http://jsfiddle.net/Bg9Zx/5/ Relevant code: <fieldset data-role=controlgroup data-type=horizontal id=locate-me> <input type=checkbox name=loc id=loc

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.