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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:48:09+00:00 2026-05-26T06:48:09+00:00

I have a column of text, with wide margins on either side. Below it,

  • 0

I have a column of text, with wide margins on either side. Below it, I have a full-width section of data (in tabular format).

I can align these against each other quite readily. My problem is that there is a ‘tab’ that sits on top of the table section. It’s narrow enough that it doesn’t interfere with the center column of text, and the layout calls for it to slide up into the white space to the left of the text.

The easy solution would a position:absolute, with top:foopx to slide it up relative to the rest of the div. The only problem is, the tab’s height is dynamic. I need to somehow to top:’height’px, but (obviously) CSS doesn’t contain anything for dynamic values.

What I need to do is align the bottom edge of the ‘tab’ against the top edge of the containing div, and I cannot for the life of me figure out any CSS statement that does that. I’d rather avoid a javascript based approach (e. g. at runtime get the height of the tab, then set top equal to that height) because the entire bottom div is refreshed from time to time using an AJAX call, and adjusting the height in that process causes the page to ‘jitter’ on the update (not sure why it doesn’t happen without the height update; the jitter is in a separate section of the code).

Requested code example:

<html>
<head>
<style>
#smallColumn
{
    float:left;
    width:100px;
    height:100px;
    background:#000;
    margin:5px;
}
#fullColumn
{
    float:left;
    width:200px;
    height:300px;
    background:#000;
    margin:5px;
}   
#bottomDiv
{
    position:relative;
}
#tab
{
    position:absolute;
    top:-40px;
}
</style>
</head>

<body>
<div id="smallColumn">a</div>
<div id="fullColumn">b</div>
<div style="clear:both"></div>
<div id="bottomDiv">
    <div id="tab">Tab</div>
<hr />
DATA DATA DATA
</div>
</body>
</html>
  • 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-26T06:48:10+00:00Added an answer on May 26, 2026 at 6:48 am

    Use top margins, the appropriate display properties and vertical-align:bottom. See the code below + comments for an explanation. You have to set a height and negative margin-top value which is larger than the actual height of the tab’s content. Otherwise, the content may jump back to the top.

    Relevant HTML/CSS:

    <div id="cont">
        <div id="tab">
            <div id="tab-fix">
                Tab
            </div>
        </div>
        Rest of content
    </div>
    
    #cont {
        margin-top: 30px; /*Reserve space*/
        height: 100px;
        background: lightgreen;
    }
    #tab {
        display: table; /* Necessary for the application */
        margin-top: -30px;/* Move tab to the top*/
    }
    #tab-fix {
        height: 30px; /* Expecting the height to not exceed 30px*/
        display: table-cell;
        vertical-align: bottom; /* Aligns the content at the bottom*/
    }
    

    Fiddle: http://jsfiddle.net/stEW3/2/

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

Sidebar

Related Questions

I have a column stored as text, this column is mainly full of numeric
I have a centered column of text, which has a fixed width. However, I
I have some tabular data. In the last column, I have 2 divs, one
How can I have multi-column text flow in div for XHTML please? (if possible)
For example: In MySQL. the data type Text , If we have a column
I have a text column that should only have 1 of 3 possible strings.
I have a text column varchar(4000) with text: 'aaabbaaacbaaaccc' and I need to remove
In MySQL, I have a text column with bla bla bla YYY=76767 bla bla
I have three column in my datagridview .One is text ,one is Combo and
I have a simple table with autoincrementing ID's and one text column. id(int), value(nvarchar)

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.