The css I started with is as follows
boxblueleft {
border: solid;
border-width: 1px;
border-color: #0000ff;
width: 200px;
min-width: 200px;
max-width: 600px;
padding-top: 0px;
padding-right: 25px;
padding-bottom: 0px;
padding-left: 0px;
position: relative;
top: 50%;
left: 50%;
transform: translateX(-50%);
box-sizing: border-box;
white-space: nowrap;
}
I can preset the actual width by fiddling with the width, min-width and max-width parameters, but as the longest string length changes, the text will overflow the box width (as it gets longer) or leaves a huge whitespace at the end of the string as it gets shorter…
Can anyone point me in the correct direction please
]]>The css I started with is as follows
boxblueleft {
border: solid;
border-width: 1px;
border-color: #0000ff;
width: 200px;
min-width: 200px;
max-width: 600px;
padding-top: 0px;
padding-right: 25px;
padding-bottom: 0px;
padding-left: 0px;
position: relative;
top: 50%;
left: 50%;
transform: translateX(-50%);
box-sizing: border-box;
white-space: nowrap;
}
I can preset the actual width by fiddling with the width, min-width and max-width parameters, but as the longest string length changes, the text will overflow the box width (as it gets longer) or leaves a hugh whitespace at the end of the string as it gets shorter…
Can anyone point me in the correct direction please
]]>In your equation you’re adding the padding and border for one side only. The other side needs to be added as well. The padding is 20px on one side of the box AND 20px on the other side of the box. All of the padding needs to be accounted for, so it must be doubled which comes to 40px total. The same goes for the border. So in the end, the calculation is:
100px width of content
40px total padding width (20px left + 20px right)
10px total border width (5px left + 5px right)
150px total
Firefox requires the browser prefix up to FF 27, Safari requires the prefix up to 5.
]]>I’m having problems with Safari and Seamonkey, when using border-box on floated divs
) http://rh-balingen.de/FLUID-GRIDS/floating.html
The height can’t be %, but has to be px.
) http://rh-balingen.de/FLUID-GRIDS/safari.html
When using relative and absolute positioning, % is OK.
) http://rh-balingen.de/FLUID-GRIDS/relative.html
I just don’t understand, what the problem is …
]]>One note, the Firefox bug with min / max-height seems to be fixed since the version 17.
Cheers,
Thomas.
I am trying to apply this property to fix a problem I have on the below page,
http://hdl.fitzroviadigital.co.uk/corporate-investment-banking/
The main section is creating a white space between the section img and the aside, however even by applying box-sizing: border-box to the universal selector, nothing changes,
Any clues?
]]>Correct, fixed.
]]>Correct, fixed.
Unprefixed in 29+. Prefixed below.
]]>