A ‘pure’ css solution actually is possible now using media queries:
.yourselector {
max-width: calc(100% - 80px);
}
@media screen and (max-width: 500px) {
.yourselector {
max-width: 500px;
}
}
More Related Contents:
- Using percentage values with background-position on a linear-gradient
- Bootstrap align navbar items to the right
- How can I override inline styles with external CSS?
- Change bootstrap navbar collapse breakpoint without using LESS
- How can I make Flexbox children 100% height of their parent?
- What’s the difference between display:inline-flex and display:flex?
- CSS Properties: Display vs. Visibility
- wordwrap a very long string
- Repeat table headers in print mode
- Why percentage value within grid-gap create overflow in CSS grid?
- IE11 – does a polyfill / script exist for CSS variables?
- Search input with an icon Bootstrap
- Hexagon shape with CSS3
- CSS renders differently on web server than on development environment
- Align text on slanted line
- Can you add noise to a CSS3 gradient?
- Get div to take up 100% body height, minus fixed-height header and footer [duplicate]
- ‘property: 0’ or ‘property: 0px’ in CSS?
- Not CSS selectors
- Why can’t I save CSS changes in Firebug? [closed]
- How to use vertical align in bootstrap
- CSS text ellipsis when using variable width divs
- Removing the image border in Chrome/IE9
- How can I reverse the order of columns in Bootstrap 4?
- CSS container div not getting height
- LESS CSS nesting classes
- CSS – First child without certain class
- CSS width 100% OR max-width in pixels
- Using SVG as background image
- Are alternate nested styles possible in CSS?