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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:12:00+00:00 2026-06-17T13:12:00+00:00

Using Twitter Bootstrap, I have a div with the following css: #notecard.hero-unit { background-image:

  • 0

Using Twitter Bootstrap, I have a div with the following css:

#notecard.hero-unit
{
    background-image: url("../img/notecard.jpg");
    background-size: cover;
    width: 60%;
    margin-left: 20%;
    margin-right: 20%;
    height: 1%;
    position: relative;
    text-align: center;
    overflow: hidden;

}

Inside of that div I have a varying amount of text h2 with the following CSS:

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: bold;
  color: #333333;
  text-rendering: optimizelegibility;
}

In #notecard.hero-unit I am using overflow: hidden; and height: 1% because most times the text from h2 scrolls further than #notecard – so that job is being handled and #notecard now expands to the text inside of h2.

However, when h2 only has a line or two, #notecard is very small. I would like #notecard to be a default size – let’s say 300px and still accept the overflow if there is any.

I’ve tried setting height at #noteard and also height at h2 to 300px, but both ignore the overflow that I need.

Thanks.

  • 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-17T13:12:01+00:00Added an answer on June 17, 2026 at 1:12 pm

    I’d use a min-height on the parent of the H2:

    <style>
    h1, h2, h3, h4, h5, h6 {
      margin: 0;
      font-weight: bold;
      color: #333333;
      text-rendering: optimizelegibility;
    }
    .hero-unit {
      background-color: #eee;
      background-size: cover;
      width: 60%;
      margin-left: 20%;
      margin-right: 20%;
      min-height: 50px;
      position: relative;
      text-align: center;
      overflow: hidden;
    }
    </style>
    
    <div class="hero-unit">
       <h2>Some Text</h2>
    </div>
    <br>
    
    <div class="hero-unit">
       <h2>Much more text. Much more text. Much more text. Much more text. Much more text. Much more text. Much more text. Much more text. Much more text. Much more text. Much more text. Much more text. Much more text. Much more text. Much more text. Much more text. Much more text. Much more text. Much more text. Much more text. Much more text. </h2>
    </div>
    

    http://jsfiddle.net/M9bX8/5/

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

Sidebar

Related Questions

I'm using twitter bootstrap with grails and have the following in my layout: <div
I'm using Twitter Bootstrap and I have the following: <div class=row> <div class=span3> <div
I have the following layout, using Twitter Bootstrap: <div class=row> <div class=span8> <div class=row>
I have the following markup using a twitter bootstrap modal plugin: <div class=tabbable> <ul
I'm using Twitter Bootstrap. I have the following code... <div class=row> <div class=span5> <%=
I'm having a design/css issue. I'm using Twitter Bootstrap and have a .row-fluid, with
I have the following problem. I am using a twitter bootstrap to make my
I have a responsive layout using Twitter Bootstrap with two columns. div #charts shows
I have a HTML Div (I'm using Twitter Bootstrap to hide-show div2 ) looking
I'm using Twitter Bootstrap and some custom css (found here ) to have dropdown

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.