CSS Articles

Page 82 of 130

Set the initial length of a flex item with CSS

Samual Sam
Samual Sam
Updated on 15-Mar-2026 153 Views

The CSS flex-basis property sets the initial main size of a flex item before free space is distributed. It defines the default size of an element before the remaining space is distributed according to the flex factors. Syntax selector { flex-basis: value; } Possible Values ValueDescription autoDefault value. The length is equal to the length of the flexible item lengthA length unit (px, em, rem, etc.) specifying the initial length %A percentage of the parent container's main size contentSize based on the item's content Example The ...

Read More

Set how much a flex item will grow relative to the rest of the flex items with CSS

Samual Sam
Samual Sam
Updated on 15-Mar-2026 183 Views

The CSS flex-grow property controls how much a flex item will grow relative to the rest of the flex items inside a flex container. When there's extra space available, this property determines how that space is distributed among flex items. Syntax selector { flex-grow: number; } Possible Values ValueDescription 0Default value. Item will not grow. numberA positive number that defines the growth factor relative to other flex items. Example: Basic Flex Grow The following example demonstrates how flex-grow distributes extra space. The third item (Q3) has ...

Read More

Avoid wrapping flex items with CSS

Yaswanth Varma
Yaswanth Varma
Updated on 15-Mar-2026 5K+ Views

The CSS flexbox layout allows you to arrange elements in flexible containers. By default, flex items try to fit in a single line, but when they exceed the container width, they may wrap to new lines. To prevent this wrapping behavior, you can use the flex-wrap property with the nowrap value. Syntax .container { display: flex; flex-wrap: nowrap; } CSS flex-wrap Property The flex-wrap property controls whether flex items wrap onto multiple lines or stay on a single line. When set to nowrap, all flex items ...

Read More

Display the flex items with space between the lines in CSS

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 15-Mar-2026 230 Views

The CSS justify-content property with the space-between value distributes flex items evenly across the main axis, placing the first item at the start and the last item at the end, with equal space between all items. Syntax selector { display: flex; justify-content: space-between; } Example You can try to run the following code to implement the space-between value − .mycontainer { ...

Read More

Wrap the flex items with CSS

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 196 Views

The CSS flex-wrap property controls whether flex items are forced onto a single line or can wrap onto multiple lines within a flex container. By default, flex items try to fit on one line, but wrapping allows them to break onto new lines when there isn't enough space. Syntax selector { flex-wrap: value; } Possible Values ValueDescription nowrapDefault. Items are laid out in a single line wrapItems wrap onto multiple lines if needed wrap-reverseItems wrap onto multiple lines in reverse order Example: Basic Flex Wrap The ...

Read More

CSS nav-left property

George John
George John
Updated on 15-Mar-2026 228 Views

The CSS nav-left property defines which element to focus on when the user presses the left arrow key on their keyboard or remote control. This property is primarily designed for TV browsers and devices where navigation is done using directional keys rather than a mouse. Syntax selector { nav-left: target-element; } Possible Values ValueDescription #idID of the element to navigate to when left key is pressed autoBrowser determines the next element automatically Example The following example creates a navigation system where pressing the left arrow key ...

Read More

Set the flex items horizontally from right to left with CSS

Samual Sam
Samual Sam
Updated on 15-Mar-2026 248 Views

Use the flex-direction property with row-reverse value to set the flex items horizontally from right to left. This property reverses the order of flex items while maintaining horizontal alignment. Syntax selector { display: flex; flex-direction: row-reverse; } Example You can try to run the following code to implement the row-reverse value − .mycontainer { display: flex; ...

Read More

Usage of CSS grid-auto-rows property

Chandu yadav
Chandu yadav
Updated on 15-Mar-2026 96 Views

The CSS grid-auto-rows property sets the default height for grid rows that are created automatically (implicitly) when grid items don't fit in the explicitly defined rows. This property is essential for controlling the sizing of rows in CSS Grid layouts. Syntax selector { grid-auto-rows: value; } Possible Values ValueDescription lengthFixed size in px, em, rem, etc. %Percentage of the grid container's height min-contentMinimum size needed to fit content max-contentMaximum size needed for content autoSize based on content (default) frFraction of available space Example: Fixed Row Height ...

Read More

Usage of CSS grid-row-start property

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 15-Mar-2026 64 Views

The CSS grid-row-start property specifies on which row line a grid item will start. This property allows you to control the exact row position where a grid item begins, giving you precise control over grid layout positioning. Syntax selector { grid-row-start: value; } Possible Values ValueDescription autoDefault value. The item will be placed automatically line-numberSpecifies which row line to start at (1, 2, 3, etc.) line-nameSpecifies a named grid line to start at span nSpecifies how many rows the item will span Example: Basic Grid Row Start ...

Read More

Set the flex items vertically from bottom to top with CSS

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 824 Views

Use the flex-direction property with column-reverse value to set the flex items vertically from bottom to top. This reverses the normal column direction, making items stack from the bottom upward. Syntax .container { display: flex; flex-direction: column-reverse; } Example The following example demonstrates how to arrange flex items vertically from bottom to top using column-reverse − .mycontainer { display: flex; ...

Read More
Showing 811–820 of 1,299 articles
« Prev 1 80 81 82 83 84 130 Next »
Advertisements