CSS3 properties
CSS hacks...
CSS3 FTW!
Properties
box-sizing
content-box
(initial): The width and height properties are measured including only the content, but not the padding, border or margin.border-box
: The width and height properties include the padding and border, but not the margin.: The width and height properties include the padding size, and do not include the border or margin.padding-box
width: *-content
max-content
: The element width grows with the width of the content similar to an inline element like <span>min-content
: The width of the element contracts to the narrowest possible width the content allowsfit-content
: The larger of: 1the intrinsic minimum width, and 2the smaller of the intrinsic preferred width and the available width
Objects
Properties for objects: images, videos, and embeds.
object-fit
- Determines how objects fit within their defined with/height or container.
fill
(default): fill the entire space, ignore aspect ratiocontain
: expand or contract the image, maintaining aspect ratio.cover
: expand or contract until it covers the width and hight while maintaining aspect rationone
: ignore the box width and hightscale-down
: Scale the image until it either fits within the box size (contain
) or reaches its original size (none
)...object-position
- Position the object within the box
- Accepts a
<position>
coordinate liketop
,bottom right
,10px 20px
,50% 10%
, etc. The initialobject-position
is50% 50%
.
Values and Units
calc()
- Mathematical expressions with addition, subtraction, multiplication, and division
toggle()
- Allows descendant elements to cycle over a list of values instead of inheriting the same value.
attr( attribute-name <type-or-unit>? [, <fallback> ]? )
- Applies the value of an HTML or XML attribute such as data-*.
- ლ(ಠ益ಠლ) Meager browser support (polyfill)