New way I’ve just stumbled upon: css calc()
:
.calculated-width {
width: -webkit-calc(100% - 100px);
width: -moz-calc(100% - 100px);
width: calc(100% - 100px);
}
Source: css width 100% minus 100px
More Related Contents:
- Percentage Height HTML 5/CSS
- How can I make a div not larger than its contents?
- How to make an element width: 100% minus padding?
- Canvas is stretched when using CSS but normal with “width” / “height” properties
- Why doesn’t height: 100% work to expand divs to the screen height?
- Make body have 100% of the browser height
- How to make a div fill a remaining horizontal space?
- How to make a div 100% height of the browser window
- Make div (height) occupy parent remaining height
- Position: absolute and parent height?
- make div’s height expand with its content
- How to make div’s percentage width relative to parent div and not viewport
- Height percentage not working in CSS
- Width 100% with white borders around it. WHy?
- Make an image width 100% of parent div, but not bigger than its own width
- resizes wrong; appears to have unremovable `min-width: min-content`
- How do browsers calculate width when child depends on parent, and parent’s depends on child’s
- How might I force a floating DIV to match the height of another floating DIV?
- Word wrap a link so it doesn’t overflow its parent div width [duplicate]
- How to set a percentage height value in HTML/CSS
- Canvas is stretched when using CSS but normal with `width` & `height` attributes
- How to fill 100% of remaining height?
- CSS – make div’s inherit a height
- How to Create Border In Css Iike
- Table fixed header and scrollable body
- How to vertically align text inside a flexbox?
- display: inline-block extra margin [duplicate]
- One tall div next to two shorter divs on Desktop and stacked on Mobile with Bootstrap 4
- Pure CSS Continuous Horizontal Text Scroll Without Break
- click link below a higher z-index div [duplicate]