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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:29:47+00:00 2026-06-14T22:29:47+00:00

I have have 3 parent divs with their classes. They separate the three parts

  • 0

I have have 3 parent divs with their classes. They separate the three parts of a page : Header, body and footer sections. The header is ok. In the body I have a div that should draw a line sth like ruler.

I put the loop code into this line to draw it but it fails so I set a absolute position so as the content increase height of the ruler/line increase too. Then in the footer for some reason I should set position:relative; but when I do, the footer div appear over the body div.

How can I fix it?

Note that the height of body and ruler/line is auto and when I set a background color for the body it doesn’t make any difference.

code sample:

html

<body>
<div class="header">it's own code and classes</div>
<div class="body">
  <div class="line">
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <div class="post">
      <div class="title"><a href="<?php the_permalink(); ?>" rel="bookmark"><h3><?php the_title(); ?></h3></a></div>
      <div class="cont"><?php get_the_excerpt();?></div>
     <?php the_post_thumbnail('45*45'); ?>
  </div>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
</div>
<div class="footer"><div class="ftr"></div></div>
</body>

and in the css part I have these:

.body {
height:auto;
width:950px;
margin:0 auto 0 auto;
background:#098;
 }

 .line {
width:4px;
height:auto;
background:#000;
position:absolute;
right:640px;
padding-top:100px;
padding-bottom:30px;
 }
 .post{
width: 460px;
height:170px;
background: #fff;
position: relative;
border-radius:10px;
-webkit-filter: drop-shadow(0 1px 5px rgba(0,0,0,.5));
-moz-filter: drop-shadow(0 1px 5px rgba(0,0,0,.5));
-ms-filter: drop-shadow(0 1px 5px rgba(0,0,0,.5));
-o-filter: drop-shadow(0 1px 5px rgba(0,0,0,.5));
filter: drop-shadow(0 1px 5px rgba(0,0,0,.5));
direction:ltr;
float:right;
margin-right:21px;
border-top-right-radius:0px 0px;
 }
     .post:after {
    content: "";
    position: absolute;
    top: 6%;
    margin: -10px 0 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    right: -10px;
    border-left: 10px solid #999;
     }
 .title {
width:90px;
height:15px;
margin-top:-13px;
margin-right:10px;
margin-left:10px;
 }

 .cont{
width:300px;
margin-top:15px;
float:right;
margin-right:13px;
 }
 .footer {
width:999px;
height:200px;
margin:auto;
 }
.ftr {
    width:999px;
    height:200px;
    background:#000;
    position:relative;
    clear:both;
}
    .ftr:after{
        content:"";
        position:absolute;
        top:-9px;
        right:500px;
        border-left:10px solid transparent;
        border-right:10px solid transparent;
        border-bottom:10px solid #06c;
    }

EDITED: this is what I wanted

.body {
height:auto;
width:950px;
margin:0 auto 0 auto;
background:#098;
 }

 .line {
width:4px;
**height:100%;** //this fixed the problem
background:#000;
padding-top:100px;
padding-bottom:30px;
 }
 .post{
width: 460px;
height:170px;
background: #fff;
position: relative;
border-radius:10px;
-webkit-filter: drop-shadow(0 1px 5px rgba(0,0,0,.5));
-moz-filter: drop-shadow(0 1px 5px rgba(0,0,0,.5));
-ms-filter: drop-shadow(0 1px 5px rgba(0,0,0,.5));
-o-filter: drop-shadow(0 1px 5px rgba(0,0,0,.5));
filter: drop-shadow(0 1px 5px rgba(0,0,0,.5));
direction:ltr;
float:right;
margin-right:21px;
border-top-right-radius:0px 0px;
 }
     .post:after {
    content: "";
    position: absolute;
    top: 6%;
    margin: -10px 0 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    right: -10px;
    border-left: 10px solid #999;
     }
 .title {
width:90px;
height:15px;
margin-top:-13px;
margin-right:10px;
margin-left:10px;
 }

 .cont{
width:300px;
margin-top:15px;
float:right;
margin-right:13px;
 }
 .footer {
width:999px;
height:200px;
margin:auto;
 }
.ftr {
    width:999px;
    height:200px;
    background:#000;
    position:relative;
    clear:both;
}
    .ftr:after{
        content:"";
        position:absolute;
        top:-9px;
        right:500px;
        border-left:10px solid transparent;
        border-right:10px solid transparent;
        border-bottom:10px solid #06c;
    }

EDIT 2: Still I have problem with drawing the line. Because the content is dynamic if I set height:100% or sth in pixel scale or even min-height when the contents increase or decrease It doesn’t make changes in height of line

  • 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-14T22:29:48+00:00Added an answer on June 14, 2026 at 10:29 pm

    When you put something in position:absolute;, they are taken out of their container context and do not expand them. So when you put your footer in position:relative;, it falls where div class="body" ends, but since it contains nothing but line (which is absolute), body is empty and thus, footer appears “under” footer.

    If I understand what you want, you should probably close line, so that “posts” are not in position:absolute; too.

    <div class="body">
      <div class="line"></div><!--here-->
        <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
        <div class="post">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a main parent div that is .resizable(). One of it's child divs,
I have one Parent div. Top of the Parent div contains two child divs.
I have a parent div that must stay at 100% with 3 child divs
I have a parent div that is filled with multiple child divs (see here
I have a page where a plugin adds child div's to a parent div
I have a parent div and few other divs nested in it containing text.
I have a parent div with a variable number of equally sized child divs
I have 2 parent divs (old & new), if I click the Click to
I have created a parent div and inserted div's after the parent div using
I have a collection of parent div s that are labeled with unique order

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.