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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:08:40+00:00 2026-05-17T22:08:40+00:00

all! I’m the begginer at html and css and I try to create the

  • 0

all! I’m the begginer at html and css and I try to create the block, which consists of three parts: top, content, bottom. Top and bottom are some pictures with round corners. And the third part-“content” has colour background, there will be some information. I tried to do this with tags div and css styles in several ways.

<style type="text/css">
#top{margin-top: 50px;background:url(background/bg_content_top.gif) no-repeat;width: 851px;text-indent: -900%;}
#middle{background:#FFF; border-left: solid 2px #000; border-right: solid 2px #000;width: 851px;}
#bottom{background:url(background/bg_content_bottom.gif) no-repeat; text-indent: -900%; width: 851px;}
</style>
<body>
<div id="top">top div</div>
<div id="middle">text will be here</div>
<div id="bottom"> bottom div</div>
</body>

the problem is: if I use

<p>text will be here</p>

there are will be odd strings between divs.
Another try:

#top{position: absolute; margin-top: 50px; background:url(background/bg_content_top.gif)no-repeat; width: 851px;}
#middle{position: relative; margin-top: 16px; background:#FFF; border-left: solid 2px #000; border-right: solid 2px #000;}
#bottom{background:url(background/bg_content_bottom.gif) no-repeat bottom;text-indent: -900%;}
<body>
<div id="top">
<div id="middle">
<p>text will be here</p>
<div id="bottom">lower div</div>
</div></div>
</body>

Another problem, background middle div paints over the transparent corners of bottom picture.
Help plz, how can I do this in the right way?

  • 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-17T22:08:40+00:00Added an answer on May 17, 2026 at 10:08 pm

    The problem with the three-divs-in-a-row is margin collapsing. If the last element in a block has bottom-margin, this margin can move out of its parent element(s) and potentially combine with the top-margin of the next statically-positioned element, or just end up in between.

    The simple way to avoid it is just to avoid using vertical margins at all. If you can use padding instead, that doesn’t collapse, which makes layout much easier. Alternatively, you can make a solid barrier that margins won’t collapse through by putting padding or a border on that edge of the parent. Even padding: 1px 0 is enough to stop any collapsing.

    Nesting backgrounds can also work, nesting all divs together:

    <div class="box0"><div class="box1"><div class="box2">
        content here
    </div></div></div>
    

    however then you will need to offest the background areas to stop one background overwriting another. eg with a top and bottom image 50px high:

    .box0 { background: url(box/top.gif) top center repeat-x; padding-top: 50px; }
    .box1 { background: url(box/bottom.gif) bottom center repeat-x; padding-bottom: 50px; }
    .box2 { background: url(box/middle.gif) center center; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All thread create methods like pthread_create() or CreateThread() in Windows expect the caller to
I am trying to load a html page through UIWebview.I need to disable all
All the articles I've found via google are either obsolete or contradict one another.
All the recent VisualSVN Server posts made me want to check it out. I
All front-end developers know the pain of coding for Firefox, then viewing our then
All I know about the constraint is it's name ( SYS_C003415 ), but I
All I want is to be able to change the color of a bullet
All throughout an application wherever error messages (or other user messages) are used I
All I want is to update an ListViewItem's text whithout seeing any flickering. This
All too often I want a WPF slider that behaves like the System.Windows.Forms.TrackBar of

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.