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

  • Home
  • SEARCH
  • 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 9183953
In Process

The Archive Base Latest Questions

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

I am using the box display, but I cannot get my text to properly

  • 0

I am using the box display, but I cannot get my text to properly render an ellipsis. Right now the text is just overflowing past the containing element.

HTML:

<div class="outer hbox">
  <div class="hbox left-container">
    <div class="label no-wrap box-centered">Col1</div>
  </div>
  <h1 class="label no-wrap">really long title really long title really long title really long title really long title really long title really long title really long title really long title</h1>
</div>

CSS:

.outer {
  width: 400px;
  border: 1px solid black;
}
.hbox {
  -moz-box-orient: horizontal;
  -webkit-box-orient: horizontal;
  box-orient: horizontal;
  display: -moz-box;
  display: -webkit-box;
  display: box;
}
.left-container {
  border: 1px solid red;
}
.no-wrap {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
h1 {
  border: 1px solid green;
}

Example here: http://jsfiddle.net/bmclachlin/Sq7Xa/

I’ve tried wrapping the h1 in a div, changing the h1 to a div, etc., but nothing seems to work. I know I’m probably missing something obvious, any ideas?

Note: This code is being generated from a JavaScript library called qooxdoo, so I don’t have the ability to change the structure too much. I can change the h1 to a different element as well as wrap the h1 in a div if I wanted to.

  • 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-17T18:55:43+00:00Added an answer on June 17, 2026 at 6:55 pm

    the h1 tag is treated like one very long line of text because of no-wrap and this is the reason it just takes so long place as the text and overflowing just could not be applied to it. Consider example with:

    .no-wrap {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      width: 100%;
    }
    

    http://jsfiddle.net/Sq7Xa/13/

    so the h1 forced to take full width of parent container and overflow appied

    UPD: little bit closer workaround would be to define actual width to both elements, with small invasion to your code that could looks like http://jsfiddle.net/Sq7Xa/15/, note there is still 2px are inconsistency because of borders around the h1

    if you really need keep that border, there is couple workarounds with that:

    1. one using box-sizing: border-box; property to h1 http://caniuse.com/css3-boxsizing

      h1 {
        box-sizing: border-box;
        border: 1px solid green;
        width: 80%;
      }
      
    2. the other one would require another div into h1 sample code http://jsfiddle.net/Sq7Xa/18/

    But yet, I have feeling that things could be done simpler with revising code, especially display: box; which at my point bit extra.

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

Sidebar

Related Questions

I've been trying to display the box characters using PDCurses but for some reason
I am using a dialog box to display and submit a enquiry form on
I am trying to display ui datepicker ctrl in prompt box [ using impromptu
How to prompt browser to display open/save dialog box using jquery?
Using the message-box fn, I can display a modal dialog. I know this is
I have some data that I want to display as a box plot using
Alright. I am using a Modal box pop up window to display business details
I'm using CakePHP 2.0. Is it possible to display multiple fields in select/dropdown box
I'm creating multiple borders to element using box-shadow, but they don't show at Webkit.
In MS Access reports, page counts can be displayed using a text box with

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.