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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T10:04:47+00:00 2026-06-16T10:04:47+00:00

Consider the following HTML. I have a .wrap div which has left and right

  • 0

Consider the following HTML. I have a .wrap div which has left and right padding of 50px. Inside that div I have another div .full. I want to increase its default width by overcoming the padding of the .wrap.

I am setting its padding to -50px so that its width becomes equal to the width of the .wrap, but it does not work.

HTML:

<div class="wrap">
    <div class="inner">
        <div class="normal">xx</div>
        <div class="full">should be same width (300px) as wrap</div>
    </div>
</div>

CSS:

.wrap{
    height: 500px;
    width: 300px;
    margin: 0 auto;
    padding: 0 50px;
    background: yellow;
}

.full{
    background: orange;
    padding: 0 -50px;
}

Demo:
http://jsfiddle.net/WDS6X/

  • 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-16T10:04:48+00:00Added an answer on June 16, 2026 at 10:04 am

    In this case, you’d need to use margin, padding is used for space on the inside.
    Using

    margin: 0 -50px;
    

    instead of the padding in the .full-div works like you wanted it to, here is the JSFiddle provided by nienn in the comments.

    For further understanding, take a look at this SO thread containing a pretty nice explanation.

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

Sidebar

Related Questions

This problem is only in IE. Consider the following HTML: <html> <body> <div style='position:absolute;left:1em;right:1em;top:1em;bottom:1em;overflow:auto;>
Consider following HTML, I have a div class magic inside main . The magic
How to select div tag inside an anchor tag. Consider the following HTML. <a
Consider the following HTML markup. In most browsers that I have tested, the second
Consider the following html http://www.carbide-red.com/prog/test_table.html I have worked out that I can move left
Consider the following HTML: <select> <option value=hasAttr>Has a value attr</option> <option>Does not have a
I have the following html: A div, which contains a label and a drop
Consider following HTML. I have .image and .details wrapped in .wrap . Outside the
Consider the following HTML snippet. The desired effect is to have a dropdown be
Consider the following: HTML <div class=info_bubble> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.

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.