CSS
-Tricks
treehouse :
what would you like to learn today?
Web Design
Web Development
iOS Development
Show search box
Search
Search in:
All
Articles
Forums
Snippets
Videos
✕
Home
Forums
Snippets
Gallery
Videos
Almanac
Demos
Lodge
Navigation 'n' Search
Forums
Illustration by Nick Sirotich
Forums
»
CSS Combat
Div not changing % width when container padding changes
cyneWATCH
Permalink to comment
#
June 2012
I'm having a problem with a div not changing its percentage width when the container it's in (with relative positioning) changes padding.
CodePen here:
http://codepen.io/Druid-of-Luhn/pen/sliedeout-sidebar/
cyneWATCH
Permalink to comment
#
June 2012
The weirdest thing is that I don't get the bug in Mobile Safari, only on Desktop browsers (Opera, Chrome, FireFox and Safari).
wolfcry911
Permalink to comment
#
June 2012
works for me
cyneWATCH
Permalink to comment
#
June 2012
All that happens for me is that it moves; its `margin: 10px auto;` doesn't kick in, and its `width: 70%;` doesn't happen either.
It's only when I resize the browser that it works.
Add a Comment
CodePen here:
http://codepen.io/Druid-of-Luhn/pen/sliedeout-sidebar/
It's only when I resize the browser that it works.