- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Selectors
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Border Block
- CSS - Border Inline
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursor
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS - Inline Block
- CSS - Dropdowns
- CSS - Visibility
- CSS - Overflow
- CSS - Clearfix
- CSS - Float
- CSS - Arrows
- CSS - Resize
- CSS - Quotes
- CSS - Order
- CSS - Position
- CSS - Hyphens
- CSS - Hover
- CSS - Display
- CSS - Focus
- CSS - Zoom
- CSS - Translate
- CSS - Height
- CSS - Hyphenate Character
- CSS - Width
- CSS - Opacity
- CSS - Z-Index
- CSS - Bottom
- CSS - Navbar
- CSS - Overlay
- CSS - Forms
- CSS - Align
- CSS - Icons
- CSS - Image Gallery
- CSS - Comments
- CSS - Loaders
- CSS - Attr Selectors
- CSS - Combinators
- CSS - Root
- CSS - Box Model
- CSS - Counters
- CSS - Clip
- CSS - Writing Mode
- CSS - Unicode-bidi
- CSS - min-content
- CSS - All
- CSS - Inset
- CSS - Isolation
- CSS - Overscroll
- CSS - Justify Items
- CSS - Justify Self
- CSS - Tab Size
- CSS - Pointer Events
- CSS - Place Content
- CSS - Place Items
- CSS - Place Self
- CSS - Max Block Size
- CSS - Min Block Size
- CSS - Mix Blend Mode
- CSS - Max Inline Size
- CSS - Min Inline Size
- CSS - Offset
- CSS - Accent Color
- CSS - User Select
- CSS Advanced
- CSS - Grid
- CSS - Grid Layout
- CSS - Flexbox
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Paged Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS - Image Sprites
- CSS - Important
- CSS - Data Types
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS - Rounded Corner
- CSS - Border Images
- CSS - Multi Background
- CSS - Color
- CSS - Gradients
- CSS - Box Shadow
- CSS - Box Decoration Break
- CSS - Caret Color
- CSS - Text Shadow
- CSS - Text
- CSS - 2d transform
- CSS - 3d transform
- CSS - Transition
- CSS - Animation
- CSS - Multi columns
- CSS - Box Sizing
- CSS - Tooltips
- CSS - Buttons
- CSS - Pagination
- CSS - Variables
- CSS - Media Queries
- CSS - Functions
- CSS - Math Functions
- CSS - Masking
- CSS - Shapes
- CSS - Style Images
- CSS - Specificity
- CSS - Custom Properties
- CSS Responsive
- CSS RWD - Introduction
- CSS RWD - Viewport
- CSS RWD - Grid View
- CSS RWD - Media Queries
- CSS RWD - Images
- CSS RWD - Videos
- CSS RWD - Frameworks
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
CSS - inline-size Property
The inline-size property of CSS determines the horizontal or vertical size of an element's inline, based on the writing mode of the element. It relates to the width or the height properties of CSS, based on the value of writing-mode.
When the writing mode is vertically orientated, the value of inline-size relates to the height of the element, else it relates to the width of the element.
Possible Values
The CSS property inline-size takes the same value as the width and height properties.
Applies To
All elements but non-replaced inline elements, table rows, and row groups.
Syntax
Following are the different ways in which the inline-size can be declared:
Length Value
inline-size: 100px; inline-size: 20em;
percentage Value
inline-size: 45%;
Keyword Value
inline-size: max-content; inline-size: min-content; inline-size: fit-content; inline-size: auto;
Global Value
inline-size: inherit; inline-size: initial; inline-size: revert; inline-size: revert-layer; inline-size: unset;
CSS inline-size - Using Length Values
Following example demonstrates the output with writing-mode: vertical-rl and inline-size is given a length value:
<html> <head> <style> .container { writing-mode: vertical-rl; background-color: pink; border: 2px solid blue; display: inline-block; } .sampleText-px { inline-size: 100px; } .sampleText-em { inline-size: 20em; } </style> </head> <body> <h2>inline-size - length value with writing-mode: vertical-rl</h2> <div class="container sampleText-px">Sample Text-px</div> <div class="container sampleText-em">Sample Text-em</div> </body> </html>
Following example demonstrates the output with writing-mode: horizontal-tb and inline-size is given a length value:
<html> <head> <style> .container { writing-mode: horizontal-tb; background-color: pink; border: 2px solid blue; display: inline-block; } .sampleText-px { inline-size: 100px; } .sampleText-em { inline-size: 20em; } </style> </head> <body> <h2>inline-size - length value with writing-mode: horizontal-tb</h2> <div class="container sampleText-px">Sample Text-px</div> <div class="container sampleText-em">Sample Text-em</div> </body> </html>
CSS inline-size - Using Percentage Values
Following example demonstrates the output with writing-mode: vertical-rl and inline-size is given as a percentage value:
<html> <head> <style> .container { writing-mode: vertical-rl; background-color: pink; border: 2px solid blue; display: inline-block; } .sampleText-10per { inline-size: 10%; } .sampleText-65per { inline-size: 65%; } </style> </head> <body> <h2>inline-size - percentage value with writing-mode: vertical-rl</h2> <div class="container sampleText-10per">Sample Text-10%</div> <div class="container sampleText-65per">Sample Text-65%</div> </body> </html>
Following example demonstrates the output with writing-mode: horizontal-tb and inline-size is given as a percentage value:
<html> <head> <style> .container { writing-mode: horizontal-tb; background-color: pink; border: 2px solid blue; display: inline-inline; } .sampleText-10per { inline-size: 10%; } .sampleText-65per { inline-size: 65%; } </style> </head> <body> <h2>inline-size - percentage value with writing-mode: horizontal-tb</h2> <div class="container sampleText-10per">Sample Text-10%</div> <div class="container sampleText-65per">Sample Text-65%</div> </body> </html>
CSS inline-size - Using Keyword Values
Following example demonstrates the output with writing-mode: vertical-rl and inline-size is given as a keyword value:
<html> <head> <style> .container { writing-mode: vertical-rl; background-color: pink; border: 2px solid blue; display: inline-block; } .sampleText-auto { inline-size: auto; } .sampleText-max { inline-size: max-content; } .sampleText-min { inline-size: min-content; } .sampleText-fit { inline-size: fit-content; } </style> </head> <body> <h2>inline-size - keyword value with writing-mode: vertical-rl</h2> <div class="container sampleText-auto">Sample Text - auto</div> <div class="container sampleText-max">Sample Text - max-content</div> <div class="container sampleText-min">Sample Text - min-content</div> <div class="container sampleText-fit">Sample Text - fit-content feature</div> </body> </html>
Following example demonstrates the output with writing-mode: horizontal-tb and inline-size is given as a keyword value:
<html> <head> <style> .container { writing-mode: horizontal-tb; background-color: pink; border: 2px solid blue; display: inline-block; } .sampleText-auto { inline-size: auto; } .sampleText-max { inline-size: max-content; } .sampleText-min { inline-size: min-content; } .sampleText-fit { inline-size: fit-content; } </style> </head> <body> <h2>inline-size - keyword value with writing-mode: horizontal-tb</h2> <div class="container sampleText-auto">Sample Text - auto</div> <div class="container sampleText-max">Sample Text - max-content</div> <div class="container sampleText-min">Sample Text - min-content</div> <div class="container sampleText-fit">Sample Text - fit-content feature</div> </body> </html>
To Continue Learning Please Login
Login with Google