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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:11:44+00:00 2026-05-28T06:11:44+00:00

What’s the simplest way to achieve the following with HTML/CSS: +———+—————————————————+ | my |

  • 0

What’s the simplest way to achieve the following with HTML/CSS:

+---------+---------------------------------------------------+
| my      | Home About Categories Donate                      |
| best    +---------------------------------------------------+
| website | Search __________                                 |
+---------+---------------------------------------------------+

Constraints:

  1. “my best website” is text, not an image, so cannot specify height of “masthead” in px
  2. The height of each of the two long rectangles should take up 50% of the height of the square box
  3. The two long rectangles should stretch “all the way” to the right

Here is my best attempt:

#masthead {
    background-color:red;
}
#masthead-sitename {
    font-size:3em;
    float:left;
    color:white;
    padding:20px;
    background-color:black;
    width:188px;
}
#masthead-twobars {
    float:left;
    background-color:green;
}
#masthead-menu {
    float:left;
    width:100%;
    font-size:x-large;
    color:white;
    padding:20px;
    background-color:gray;
}
#masthead-search {
    float:left;
    width:100%;
    font-size:x-large;
    color:white;
    padding:20px;
    background-color:yellow;
}
<div id="masthead">
    <div id="masthead-sitename" >
        my<br/>best<br/>website
    </div>
    <div id="masthead-twobars" >
        <div id="masthead-menu">
            Home About Categories Donate
        </div>
        <div id="masthead-search">
            Search
        </div>
    </div>
</div>

It fails because the two long rectangles do not stretch all the way to the right, and the heights of the two long rectangles do not add up to the height of “masthead-sitename”

  • 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-28T06:11:45+00:00Added an answer on May 28, 2026 at 6:11 am

    Give the masthead left padding as wide as the site name, then position the sitename absolutely over the padding. Don’t float the bars, don’t give them width. They’ll just naturally fill the container without overlapping the left padding. Set the sitename’s height to 100% and make the bars tall enough to fully display the site name.

    Demo: http://jsfiddle.net/d6xsQ/1/

    .masthead { 
        padding-left: 218px;
        background-color:red; 
        position: relative;
    } 
    .masthead .sitename {
        position:absolute;
        left: 0;
        top: 0;
        font-size:3em; 
        color:white; 
        background-color:black; 
        width:218px;
        height: 100%;
        overflow: hidden;
    } 
    .masthead .sitename > div {
        padding:20px;
    }
    .masthead .bar { 
        font-size:x-large; 
        padding:40px 20px;
    }
    .masthead .menu { 
        background-color:gray;
        color:white;
    }
    .masthead .search {
        background-color:yellow; 
    }
    
    <div class="masthead">
        <div class="sitename" >
            <div>
                my<br/>best<br/>website
            </div>
        </div>
        <div class="bar menu">
            Home About Categories Donate
        </div>
        <div class="bar search">
            Search
        </div>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
i got an object with contents of html markup in it, for example: string
I have thousands of HTML files to process using Groovy/Java and I need to

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.