Bug 171430
Summary: | Buttons with zero width still affect parent's width | ||
---|---|---|---|
Product: | WebKit | Reporter: | Cedric Reichenbach <cedric.reichenbach+webkit-bugzilla> |
Component: | CSS | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED CONFIGURATION CHANGED | ||
Severity: | Normal | CC: | bfulgham, simon.fraser, zalan |
Priority: | P2 | ||
Version: | Safari 10 | ||
Hardware: | All | ||
OS: | All |
Cedric Reichenbach
When setting `width: 0` on buttons in a container with variable with, they still occupy space (but are invisible). As a consequence, the container element has the same with as if those buttons had default width.
Example:
HTML:
<div class="parent">
<button class="child">a</button>
<button class="child">b</button>
<button class="child">c</button>
</div>
CSS:
.parent {
float: left;
border: 2px solid darkblue;
}
.child {
float: left;
width: 0px;
padding: 0;
margin: 0;
border: none;
overflow: hidden;
}
.parent:hover .child {
width: auto;
}
The a sample in JSFiddle can be found here: https://jsfiddle.net/4rsd84yg/9/
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Brent Fulgham
In Safari 15.5+ all buttons show zero width, and the 'parent' container has zero width.