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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:04:22+00:00 2026-05-18T08:04:22+00:00

My problem is best outlined with this schematic/image which outlines how I want it

  • 0

My problem is best outlined with this schematic/image which outlines how I want it to look:

http://i51.tinypic.com/28thuh0.jpg
!

I have a background image and 2 divs for text over the top of it (headline, and intro-text). I also have 2 divs on either side of the headline – these are for the white horizontal stripes.

My issue is that the headline is changeable in a CMS, and I want the horizontal white stripes to automatically fill up the space to the left and to the right of it, regardless of the headline’s width.

I can’t figure out how to make those 2 horizontal white stripes resize automatically.

Here’s my HTML:

<div id="masthead">
<div id="headline-container">   
    <div id="left-stripe">&nbsp;</div><div id="headline">{headline}</div><div id="right-stripe">&nbsp;</div>
</div>
<div class="clear-both">&nbsp;</div>
<div id="intro-text">{intro_text}</div>
</div>

And here’s my CSS – ignore the widths specified for the left-stripe and right-stripe – they’re just placeholders:

#masthead {
    height: 260px;
}

div#headline-container {
    width:960px;
    padding:none;
}
div#left-stripe{
    float: left;
    background-color:#fff;
    height: 3px;
    width:500px;
    display: inline;
}
div#right-stripe{
    float: right;
    background-color:#fff;
    height: 3px;
    width:100px;
    display: inline;
}
div#headline {
    text-align:right;
    color: #fff;
    font-size: 200%;
    float: left;
    display: inline;    
}
div#intro-text {
    text-align: left;
    float: right;
    width: 300px;
    color: #fff;
}

Ideas? Please let me know if I can provide more detail.

  • 1 1 Answer
  • 1 View
  • 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-18T08:04:22+00:00Added an answer on May 18, 2026 at 8:04 am

    I’m a bit too busy to actually test this, but this might give you some direction. i’m not sure the exact effect you’re trying to achieve (see comment about finding a live demo someone made).

    Regardless, this kind of fluid layout is a bit difficult to achieve reliably with straight CSS. To make it easier I would suggest making the right-stripe a static width.

    This CSS solution MIGHT work… no promises.

    markup

    <div class="container">
      <div class="headline-container">
       <div class="left-stripe"></div>
       <div class="headline">Headline goes here</div>
       <div class="right-stripe></div>
      </div>
      <div class="content"></div>
    </div>
    

    CSS

    //static width for right stripe
    .right-stripe { width: 20px; }
    .headline { width: auto; }
    .left-stripe { width: auto; }
    

    Using javascript would make it really easy though… here’s how i would do it with jQuery. Again, I would make the right-stripe a static width to achieve this effect.

    (same markup…)

    ..

    js

    var totalWidth = $("#container").width();
    var leftWidth = totalWidth - ($("headline").width() + $("right-stripe").width());
    $("left-stripe").width(leftWidth);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for the generally accepted/best solution to this problem. Problem I have a
This problem is best described with an example. I have the following ClientBundle in
So recently I was given a problem, which I have been mulling over and
The best way to explain my problem is by a example. I have a
My problem is to find best view configuration for my application that have a
Best to use an example to describe the problem. Lets say I have a
What is the best way to solve this problem in code? The problem is
I've got a problem I'm not sure how best to solve. I have an
What would be the best algorithm to solve this problem? I spent a couple
I am trying to work out the best practice for my problem. I have

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.