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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:08:14+00:00 2026-06-16T07:08:14+00:00

Edit 1) The following problem only occurs in chrome. (i edited the title) 2)

  • 0

Edit

1) The following problem only occurs in chrome. (i edited the title)

2) I updated the fiddle again to illustrate the problem better and to show that when static text is used in the second span – it does get displayed (even in chrome.)

3) I need the limit the width of the dynamic text (so it can’t have css display: inline)

4) The title and the name have separate styles (that’s why I have 2 spans in the markup)

5) Inspect element shows me that the text is there…. but it is not displayed for some strange reason.

=============

I want to make a centered header with 2 text elements:

1) A title (static text) and

2) content (dynamic text)

I put an ellipsis on the content to ensure that it doesn’t overflow the box.

My problem is that the dynamic content – which i set through jquery isn’t showing up!

Here is a LIVE DEMO

What am i missing?

Here’s the markup:

<header class="header">
    <span class="title">Hello</span>&nbsp;
    ‎“<span id="Name" class="ellipsis name"></span>”
‎‎</header>​

CSS

.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

.header
{
    text-transform: uppercase;
    color: #952262;
    font: bold 24px arial;
    text-align: center;
    height: 45px;
    line-height: 45px;
    background-color: orange;
}

.title
{
    font-weight: normal;
}
.name
{
    display: inline-block;
    max-width: 370px;
    vertical-align: top; /*for firefox*/
}

jquery:

$(document).ready(function(){
   $('#Name').text('Dan');
})​
  • 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-16T07:08:15+00:00Added an answer on June 16, 2026 at 7:08 am

    http://jsfiddle.net/ekFpk/1/

    Remove overflow: hidden; from the CSS for .ellipsis and add it in document.ready:

    $(document).ready(function(){
       $('#Name').text('The could be a long piece of text so I need to use an ellipsis here to trim it incase it overflows the container');
       $('.ellipsis').css('overflow','hidden');
    })​;​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following problem in Cakephp: I maded a CMS to edit the
Most of you probably know the following problem: You edit an HTML, view the
FINAL EDIT: After following the answer from Darin Dimitrov, I have found that the
I register the following function //EDIT: updated $("#id").on("change", function() { alert('xxx'); }); In my
I'm looking to analyze and compare the following `signals': (Edit: better renderings here: oscillations
EDIT following resolution, this has been substantially edited to dump irrelevant detail and explain
I have the following problem: I have a simple menu, where only one menu
Following problem occurs in Microsoft Windows 7 Implementation of Qt 4.8.1: A QLocalServer (named
EDIT2 Here is the solution that works for the following problem of giving a
I use JEditable for making edit field which following code: $(function() { $(.field).editable(http://localhost/index.php/welcome/update_record, {

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.