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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:57:18+00:00 2026-06-11T16:57:18+00:00

I have two nested containers, .button-1×1 and the inner .button-content. I want to express

  • 0

I have two nested containers, .button-1×1 and the inner .button-content. I want to express .button-content dimension as a percentage, and if i do the vertical-align property is not running. It runs fine if i do set width and height as px values. Why?

The outer container has its dimension expressed as px values, so i thought i could express the nested dimension as a percentage, this would keep my css more maintenable. But this doesnt work.

Fiddle here: http://jsfiddle.net/pjZ8g/5/

Code:

<style type='text/css'>
.absolute {position:absolute}
.bg-teal {
  background-color:#abc;
}
.button-content {
  width:100%; /** Change this to px, and it will work */
  height:100%; /** Change this to px, and it will work */
  display: table-cell;
  vertical-align: middle;
  text-align:center;
  text-transform:uppercase;
}

.button-1x1 {
  width:230px;
  height:230px;
}
</style>
<div class='button-1x1 relative'>
    <div class='button button-1x1 bg-teal absolute'>
      <div class='button-content'>
        <span>test1</span>
      </div>
    </div>
</div>​
  • 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-11T16:57:19+00:00Added an answer on June 11, 2026 at 4:57 pm

    Here’s an alternative approach to techfoobar’s.

    Change the <div class='button button-1x1 bg-teal absolute'> styling to include display:table.

    See http://jsfiddle.net/pjZ8g/9/

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

Sidebar

Related Questions

I have nested containers std::map<int, std::map<T, U> > and want to populate them properly,
I have two nested packages that I am calling via fast_cgi. From the first
I have two nested loop in XSL like this, at this moment I use
I have two masterpages. A main.Master and a search.Master. The search.Master is a nested
I have two tables: Campaigns, Campaign_statistics. I need to output campaigns list with nested
I have a navigation bar that has two dropdowns (as nested ul's). I'm trying
to KIS I have two models: Reservations and Containers . Container has_many :reservations Reservation
I have a that contains two nested div's. One of the nested div's contains
I have two <div> , one nested into the other defined like this: <div
I have two containers, each triggers some function, which has to pass the object

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.