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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:07:38+00:00 2026-05-30T07:07:38+00:00

I have a crude header bar set up on fiddler: http://jsfiddle.net/bCJts/ It looks ok

  • 0

I have a crude header bar set up on fiddler: http://jsfiddle.net/bCJts/

It looks ok at present, but if you shrink the window then eventually the RH box is pushed onto the next line.

I would like to make it so that when the left and the right sections meet, the left section is reduced in width and any text is truncated – so that whatever happens, both sections remain on the same line.

I can think of several ways of doing this, but none are ideal:

1) Set a specific max-width property: However, sometimes there is no content in the LH box, which rules out using %’s as it would leave a big space. Fixed values are out because the window in which the header appears can vary in width

2) Use js to set the width on render – this is my fallback position if no css solution is available.

  • 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-05-30T07:07:40+00:00Added an answer on May 30, 2026 at 7:07 am

    well.. this almost achieve’s what you want but the RH’s height varies.. check it out yourself..

    DEMO

    If you want the contents of something to stay in the same line — your best bet is to go with tables — either the display:table ( cross browser issues creep up) way or the html’s <table> way.. i’ve given you the html’s sol as it’s cross browser compatible.And the changes are as follows..

    <div class="header">
    <table>
        <tr>
        <td class="headerLeftBlock ">
            <span class="head1">This is my Main Title and it is getting really long sometimes</span>
            <br />
            <span class="head2">This is my Subtitle</span>
        </td>
            
        <td class="headerRightBlock">
            <span>Some Menu Control maybe</span>
        </td>
    </tr>
        </table>​
    

    In css, i’ve added width:auto to enable your case of dynamic content for LH

    * {border: 0; margin: 0; padding: 0;}
    .header {height:40px;padding: 0 0 0 5px;}
    
    .head1
    {
    height:auto;
    font-size:16px;
    font-weight: bold;
    text-overflow: ellipsis;
    word-wrap:break-word;
    overflow:hidden;
    display:inline-block;
    border:1px solid red;
    }
    
    .head2
    {
    font-size:12px;
    text-overflow: ellipsis;
    white-space:nowrap;
    overflow:hidden;
    display:inline-block;
    border:1px solid red;
    }
    .headerLeftBlock {
    float:left;
    width:auto;
    overflow:hidden;
    border:1px solid green;
    }    
    
    .headerRightBlock
    {
    width:auto;
    height:auto;
    border: 1px solid green;
    }​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very crude category list right now, but I'm wanting it to
Currently what I have coded up works, but it seems rather crude. Basically here's
I am making my own crude MP3 player, and I now have a JList
I come from a web background where I only have to deal with HTTP
I have a rather crude implementation of corners for (main_bg.gif) within the wrapping global-inner
I have three columns of information and I'd like to present a portion of
I have the following (crude) function, which continually watches a directory for new files
I have written a crude Python program to pull phrases from an index in
I have a test app with multiple forms, one being a crude kind of
I have a bar that's supposed to portray time and under this bar I've

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.