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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:41:17+00:00 2026-06-13T01:41:17+00:00

<div class=hi> <div class=hello>name</div> <div class=world><img /></div> </div> .hi{ height: auto; position: relative; text-align:

  • 0
<div class="hi>
    <div class="hello">name</div>
     <div class="world"><img /></div>
</div>
.hi{
    height: auto;
    position: relative;
    text-align: center;
    width: 100%;
 }
 .hello{
      display: inline-block;
      font-size: 16px;
      font-weight: bold;
      height: 22px;
      margin: 3px 0;
      max-width: 80%;
      overflow: hidden;
 }
 .world{
       background: url("***") no-repeat scroll 0 0 transparent;
       display: inline-block;
       height: 13px;
       left: 5px;
       position: relative;
       top: -9px;
       width: 14  
}

The issue is when the name is exceeding and max width is applied the background image in world div appears misaligned(appears slightly above), while the name for which max-width is not getting applied displays it correctly.

The idea is name and image should be in the same line.with name center aligned and image next to it. and if name exceeds it should be truncated so that the image doesn’t get displayed in the next line. i am giving background image since i have an image inside a image.

the issue happens in chrome alone.

  • 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-13T01:41:18+00:00Added an answer on June 13, 2026 at 1:41 am

    max-width: 80% doesn’t mask the fact that <div> is a block-level element. When a width is not explicitly set, it will always be width:100% inherently. If you set the width of .hello to 80%, I think you’ll see what you’re expecting.

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

Sidebar

Related Questions

I have the following Code var page = '<h1>Hello!</h1><p>FOO</p><span class=username>this is ur name</span><p>sample text</p>';
Hello friends following is my code HTML <ul> <li> <div class=input><input name= type=checkbox value=
I have a div with a span <div id=div1> <span class=>hello</span> </div> When i
<div class = a> <div class = a b> text </div> </div> <script> alert($(.a).html());
I have something like this currently: <div class = className style = position: absolute;
My div with class name 'header-body-right' doesn't seem to be floating to the left
<div id=item> <div class=action> Oh! Look, a squashed pea! </div> <img class=picture src=example> </div>
<td class=participants> <img alt= src=https://s3.amazonaws.com/app-name-production/profile_pics/1/small/xxxxx.jpeg> <img alt=xxxxxxxx src=https://s3.amazonaws.com/app-name-production/profile_pics/5/small/xxxxx.jpg> </td> Hello, I have the follow
I have a div class named switch control which has a div class named
I am trying to hide the div class hideme based on value of full_day

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.