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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:53:05+00:00 2026-05-24T15:53:05+00:00

I’m looking for a solution. I have a CSS styled page. The page is

  • 0

I’m looking for a solution. I have a CSS styled page. The page is generated with Rails. The layout contains a div id="wrapper for the fix site width and the margin: 0 auto thing.

Details of my problem:


There is a header section, a navigation section and the container (and oc. the footer). The container have two columns. The content and the rightSideBar.

Ok, I start to generate the dynamic thing in the content area. This page is about predictions. I have tarot cards in a spread then every card is cycled threw again to have the explanations of the meaning of the cards.

The spread box at the top of the content area:

div#spread_box {
 width:620px; 
 background-color:#392b3f; 
 margin: 15px 15px 10px 10px; 
 display:block; 
 overflow:auto;  
 position:relative; 
 clear:both;}

I have images in it what I want to be positioned perfectly one place, so I use absolute positioning.

div#spread_box img  {border: 1px solid #000000; display: block; height: 120px; position: absolute; width: 71px;}

div#spread_box #kelta1  {left: 115px; top:168px;-webkit-transform: rotate(-90deg);-moz-transform: rotate(-90deg); filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); z-index: 500;}
div#spread_box #kelta2  {left: 115px; top:168px;}
div#spread_box #kelta3  {left: 115px; top:45px;}
div#spread_box #kelta4  {left: 115px; top:291px;}
div#spread_box #kelta5  {left: 20px; top:168px;}
div#spread_box #kelta6  {left: 210px; top:168px;}
div#spread_box #kelta7  {left: 310px; top:395px;}
div#spread_box #kelta8  {left: 310px; top:270px;}
div#spread_box #kelta9  {left: 310px; top:145px;}
div#spread_box #kelta10 {left: 310px; top:20px;}

This is the spread box. As you can see, I used the positioning technique to have this at the right place. Than comes the Rails generated content data. Each block have a class="card_detail". In this there are 3 things: A short text in a <p> that details the position. Under that in two columns the picture of the card and the explanation of it.

Because this is database generated content, I used the float technique.

div.explanation_box     { width:600px; background-color:#392b3f; border: 1px solid #000; margin: 15px 15px 10px 10px; text-align:justify; padding: 10px; overflow:auto;}
div.explanation_box p   { width:475px; }
div.explanation_pos     { margin:5px; display:block;}
div.explanation_pos p   { width:575px; }
div.explanation_card    { width:100px; float:left;}
div.explanation_img     { margin:5px; width:100px; float:left;}
div.explanation_pos img { width:100px; }

There is a container box called explanation_box with a fixed width and an overflow:auto property. The explanation_box is in the normal workflow including float positioned elements.

Sympthoms of my problem


  1. If I give an exact height:600px; to the spread_box (the container element) than everything is fine. However if I display one and only one card, than there will be a huge unused area. enter image description here

  2. If I take away the height parameter of the spread box than the whole thing is gone! enter image description here

  3. And If the overflow:auto selector is removed, than the floating elements are going up, under the absolute positioned elements.

    enter image description here

  4. If I use overflow auto and the fix height with smaller px size than the appearing content, than there will be the slider on the right side and the content will be cropped.

The Question at last


So, how can I make the spread_box have a dynamic height included a fixed positioned spread?

The content of the spread_box depends on the FORM that sends the data. So there can be everything from a single card to a really complex spread. This is why I need this!

  • 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-24T15:53:05+00:00Added an answer on May 24, 2026 at 3:53 pm

    Firstly, change overflow: auto to overflow: hidden to remove any chance of scrollbars.

    Due to the fact that your cards are absolutely positioned, and the height of all the cards together is variable, you need to work out the combined height of the cards. Then, you need to set this calculated height on #spread_box.

    You can calculate the height in either of two places:

    • In your Ruby code. You know which cards you’re outputting, and the height of each card and the top values are known to you. This might be difficult to get right, but has the advantage that it will work if JavaScript is disabled, which brings me to the next option..
    • Using JavaScript. This is the cleanest way to resolve your problem. Some JavaScript, or even just a few lines of jQuery can calculate the height of the cards.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

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.