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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:50:06+00:00 2026-06-17T05:50:06+00:00

I have a div and I am adding an image in-line, the problem is

  • 0

I have a div and I am adding an image in-line, the problem is when the image is bigger than the line-height it just increases the line-height instead of having the image go over the text.

Here is my code:

<html>
  <body>
    <div style="height:130px; width:130px;">
      one two three four five 

<img src="http://ladyenews.files.wordpress.com/2011/03/smiley-emoticon.png" style="width: 20px; height: 20px; display:in-line;">

       six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen
    </div>
  </body>
</html>

Example here: http://jsfiddle.net/dWkfq/1/

So how do I get my image to get inserted into my div without the line-height increasing, I need the image to overlap onto the text if it is too big?

I was thinking maybe somehow putting the image in another div with a max-height and then setting the overflow to visible or something but I’m afraid the answer will be much harder and involve absolute positioning with javascript.

I would just absolutely position the image on my own but the text is subject to change so I need a flexible solution.

  • 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-17T05:50:07+00:00Added an answer on June 17, 2026 at 5:50 am

    Replace

    display:in-line;
    

    with

    position:absolute;
    

    http://jsfiddle.net/ENch9/

    OR

    vertical-align:text-top;
    

    http://jsfiddle.net/c6YqG/

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

Sidebar

Related Questions

I have a function that is adding a background-image to my div. But its
Is there a way of adding a div over a gallery image when using
I am having problem with appending a div with an image to a page
So the problem is when you have a block of text, and an image
i have animated div in html. it is adding 1px to div in every
I have div ( #child ) which won't expand to the full height of
So currently I have: #div { position: relative; height: 510px; overflow-y: scroll; } However
It seems that in Firefox, if I have div A with fixed width/height and
I have a div which contain lots of input[type=text] fields. I want to put
Having a reallllll mind pain. I have a php image uploader which is all

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.