Div Width Fit Content Code Example
Example 1: css width fit to content
width: fit-content;
Example 2: make div the size of the text inside
div {
display: inline-block;
}
Example 3: css div width fit content
display: inline-block;
Example 4: width defined by content css
/* <length> values */
width: 300px;
width: 25em;
/* <percentage> value */
width: 75%;
/* Keyword values */
width: max-content;
width: min-content;
width: fit-content(20em);
width: auto;
/* Global values */
width: inherit;
width: initial;
width: unset;
Comments
Post a Comment