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

  • Home
  • SEARCH
  • 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 8609223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:49:51+00:00 2026-06-12T03:49:51+00:00

I have a content div and inside it there are two div’s with background

  • 0

I have a “content div” and inside it there are two div’s with background images (gradient and shadow). Now I have a following problem if there is a lot of content I have to resize my “content div” but when I do that a BIG GAP shows between my div’s (top and bottom divs). I know i can solve it by inserting a bigger images, but it is a no go for me because I must resize images every time when the content div gets bigger.

Is there a any way to solve this? Thank you guy’s!!!

Fiddle WITH LESS CONTENT (Haven’t resized div so it look’s good)

Fiddle WITH MORE CONTENT Resized my “content div” and there is a gap in the middle 🙁

HTML Code here:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
<meta name="author" content="Dejan Peic"/>
<meta name="description" content=""/>
<meta name="keywords" content=""/>
<title></title>

</head>
<body>

<div class="mainwrap">
<div class="content">
<p><b>LESS CONTENT LOOKS OK!!!</p>
<div class="top">
</div>

<div class="bottom">
</div>
</div><!--/content-->
</div>
</body>
</html>

CSS Code:

*{margin:0px;padding:0px}

.content{
background-color:white;
position:relative;
display:block;
width:995px;
height:528px;
margin:0px auto;
margin-top:40px;
margin-bottom:40px;
z-index:100;
overflow:hidden;
}

.top{
position:absolute;
z-index:-100;
background-image:url('http://www.robertpeic.com/Global%20one/template/content-top.png');
top:0;
width:990px;
height:203px;
background-size: contain;
}

.bottom{
position:absolute;
z-index:-100;
background-image:url('http://www.robertpeic.com/Global%20one/template/content-bottom.png');
bottom:0;
width:989px;
height:225px;
background-size: contain;
}

p{
margin-left:50px;
margin-top:20px;
font-size:25px;
}
  • 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-12T03:49:52+00:00Added an answer on June 12, 2026 at 3:49 am

    Divide the background image into three parts rather than two:

    <div id="top"></div>
    <div id="middle"></div>
    <div id="bottom"></div>
    

    Place all your content in the middle div, then give it a background image that repeats vertically (background-repeat: repeat-y). When the amount of content increases, the middle div will get taller and the background will repeat vertically to match, so you’ll never end up with a gap.

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

Sidebar

Related Questions

I have a centred fixed width content div , and if there isnt enough
Imagine you have two views with code like the following: controller_a/a.html.erb <%= content_tag(:div) do
I have two <fieldset> s inside a single div (nothing else), that are positioned
Ok so i have a div that acts as a background for two divs(filled
Up to now I have two choices (maybe there are more outside): Set the
I have html structure like this: <div class='inside'> <div>429185</div> <div>492128</div> </div> Sometimes there is
I have two divs placed inside a larger div. Each one of these two
I have a div classed content. Inside the div , is a h1 tag.
I have a content div that surrounds all my content, a navigation div and
I have dynamic content in a div called txtresults like this: <div id=txtresults></div> This

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.