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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:07:11+00:00 2026-06-05T09:07:11+00:00

See this jsFiddle… http://jsfiddle.net/M4FAr/ CSS: a {display:inline-block;background:gold} a > * {display:inline-block;margin:0} p {width:auto;line-height:30px;background:yellowgreen} div

  • 0

See this jsFiddle…

http://jsfiddle.net/M4FAr/

CSS:

a {display:inline-block;background:gold}
a > * {display:inline-block;margin:0}
p {width:auto;line-height:30px;background:yellowgreen}
div {width:30px;height:30px;background:orangered}​

HTML:

<a>
    <p>left</p>
    <div></div>
</a>​

Now, why does setting height:30px to the div on the right create a gap above the p on the left? And how do I get rid of it?

I just want the container a to be 30 pixels heigh and no more. Also, I want its children to line up.

  • 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-05T09:07:13+00:00Added an answer on June 5, 2026 at 9:07 am

    A simple a > * {float:left} solved my problem…

    a {display:inline-block;background:gold}
    a > * {margin:0;float:left}
    p {line-height:30px;background:yellowgreen}
    div {width:30px;height:30px;background:orangered}​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please see this : http://jsfiddle.net/ymSpY/ . If you can see <td> has an inner
I'm working with something like this: http://jsfiddle.net/Hh2Ht/ As you can see, I have a
This is my code http://jsfiddle.net/noppanit/8D7QN/ As you can already see that the text overflows
You can see the example here: http://jsfiddle.net/8EHED/8/ This is a tricky problem because I
http://jsfiddle.net/YaMhn/8/ ^^^^Take a look and see if you can help solve this Ok so
This is my code: http://jsfiddle.net/WCP5f/2/ If you open it with Chrome, you will see
If you take a look at this fiddle in Chrome: http://jsfiddle.net/up4Fa/ You will see
I'm running this code in Firefox 11 on Windows 7. (See http://jsfiddle.net/QStkd/ ). $('<div><input
I have chart of winning positions. http://jsfiddle.net/DhcTV/4/ like this. As you can see the
Please see this jsFiddle: https://jsfiddle.net/Wmq6f/ I have a textarea that has a background image,

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.