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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:46:02+00:00 2026-05-23T16:46:02+00:00

I have div that contains a img element then directly below that is a

  • 0

I have div that contains a img element then directly below that is a div element then below that is another img element.

My Problem: there should be no vertical gaps between any of those elements. But what happens is that there is a 10/20px vertical gap between the middle div & the imgs(on top & bottom).

How do I remove the vertical gap between the inner div & the 2 img elements?

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/homepage.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <style type="text/css">
    <!--

        /* Test Specific */

/*Perform CSS Reset*/
        html, body, div, form, fieldset, legend, label, img {  margin: 0;  padding: 0;  }  table {  border-collapse: collapse;  border-spacing: 0; }  th, td {  text-align: left;  }  h1, h2, h3, h4, h5, h6, th, td, caption { font-weight:normal; }  img { border: 0; } 

        .pageBox                    { width: 700px; display: block; }
        .pageBoxContent             { background: url("images/pageBoxMid.png") repeat-y; background-color: red;
                                      padding-right: 50px; padding-left: 50px; width: 700px; }
        .pageBoxContent p           { font-family:Calibri, "Myriad Pro", Serif; }
        .pageBoxTop                 { background-color: blue; }
        .pageBoxBottom              { background-color: blue; }

    -->
    </style>

</head>
<body>

    <div>

        <div class="pageBox">
            <img class="pageBoxTop" src="images/pageBoxTop.png" alt=""/>
            <!-- Gap appears here on display -->
            <div class="pageBoxContent">
                <p class="subHeading">Upcoming Events</p>
                <p>abcedefdfdgdf</p>
                <p>abcedefdfdgdf</p>
                <p>abcedefdfdgdf</p>
                <p>abcedefdfdgdf</p>
            </div>
            <!-- Gap appears here on display -->
            <img class="pageBoxBottom" src="images/pageBoxBottom.png" alt=""/>
        </div>
        <br/>

        <br/>

    </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-23T16:46:02+00:00Added an answer on May 23, 2026 at 4:46 pm

    Set the margin for the Paragraph inside the div.Since P has a default margin you have to clear that first or set that to your desired value.

    .pageBoxContent p{ font-family:Calibri,"Myriad Pro", Serif; margin:0;//adjust it}
    

    If you want some gap inside p , you can set the first and last only like p:first & p:last

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

Sidebar

Related Questions

I have an ASP.Net page that contains a <div> with an <img> tag within.
I have a div that contains a ul and in each li there is
Alright I have a div that contains an image, <div id=image> <img src=images/medium/1.png />
I have a div that contains an image and a p tag (seen below).
I have a container div that contains some img tags. When I click on
I have a div that contains 3 fields You can see the image here
I have a div that contains two other divs,, like this: ---------------------------- | |
(The target browser is IE8) I have a div that contains a list of
I have a wrapper div that contains arbitrary content (I don't know its length).
I have the following mark up of a div that contains a form. The

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.