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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:39:04+00:00 2026-06-04T06:39:04+00:00

I have an absolute element inside a relative container. The absolute element has its

  • 0

I have an absolute element inside a relative container. The absolute element has its width:100% which gives the width of the relative container element.

My goal is for the absolute element to stretch beyond the 100% of the container, 40px from right and left.

This I am trying to achieve by setting pading left & right to 40px on the relative container, together with box-sizing: content-box;. The problem is that the absolute element doesn’t stretch to 100% of the relative container. Instead it stretches only within the content space without including the padding.

Edit
Turns out that this is only in Chrome.

  • 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-04T06:39:06+00:00Added an answer on June 4, 2026 at 6:39 am

    You need to use jQuery here to calculate the width of DIV with paddings. Basically we need to apply the .outerWidth() of DIV to the table –

    Demo – http://jsfiddle.net/GDU7Q/

    Hope this helps!

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

Sidebar

Related Questions

I have a FF problem when using an absolute element inside a relative container
I have a container element which I need to resize as its contents change.
I have an element in a page which is absolute positioned using TOP and
Is it possible to position an element within a relative positioned container absolute to
I have a container div, and it needs to be positioned as relative. Inside
I have this function inside a $(document).ready $('.roundabout-in-focus').click(function(){ $(this).css({position:'absolute',height:'300px',width:'400px',left:'120px',top:'-20px'}); }); Which works fine, The
I have a container div element that has overflow:hidden on it. Unfortunately this property
I have a <div> element with position: absolute and z-index something big. I would
I have overlay inside HTML element and inside that overlay I have element that
1) With Html elements that don’t have runat = server attribute, absolute and relative

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.