- Scenario:
- Consider the elements
parent
,child1
, andchild2
child2
has itsheight
andoverflow
properties set so that its content displays with a vertical scrollbar- Both
child1
andchild2
contain child elements with percentage-basedwidth
values
- Consider the elements
Observation: It seems that in the case where child2
has a vertical scrollbar, the 100% width of child2
does not account for the scrollbar's width. This behavior has been noted on Chrome but a cross-browser solution is preferred.
Summary:
When only one of parent.child1
and parent.child2
has a vertical scrollbar, the computed width of child elements in child1
and child2
differ.
Question: How can I organize parent
, child1
, child2
, and their respective children so that the percentage-based width calculations for child1
and child2
align?
Possible solutions may involve techniques like absolute positioning of background layers, leveraging "modern" HTML5/CSS3 features, and other creative methods.
Thank you in advance!