Web Development Articles

Page 668 of 801

Values of CSS overflow property

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

CSS provides a property called overflow that tells the browser what to do if the box's contents are larger than the box itself. Syntax selector { overflow: value; } Possible Values ValueDescription visibleAllows the content to overflow the borders of its containing element hiddenThe content is cut off at the border and no scrollbars are visible scrollScrollbars are added to allow scrolling through the content autoScrollbars appear only if the content overflows Example: Visible Overflow The following example demonstrates the visible value where content overflows outside ...

Read More

What to do when an element's content might be larger than the amount of space allocated to it?

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

The CSS overflow property controls what happens when an element's content is too large to fit in the allocated space. This property allows you to specify whether content should be clipped, scrollable, or visible. Syntax selector { overflow: value; } Possible Values ValueDescription visibleContent overflows the element's boundary (default) hiddenContent is clipped and hidden scrollAdds scrollbars to view overflowing content autoAdds scrollbars only when needed Example: Using Scroll and Auto Values The following example demonstrates how overflow: scroll and overflow: auto handle content that exceeds container ...

Read More

Which property is used to tell the browser what to do if the box's content is larger than the box itself?

Arjun Thakur
Arjun Thakur
Updated on 15-Mar-2026 261 Views

CSS provides a property called overflow which tells the browser what to do if the box's content is larger than the box itself. Syntax selector { overflow: value; } Possible Values Value Description visible Allows the content to overflow the borders of its containing element (default) hidden The content is clipped at the border and no scrollbars are visible scroll Scrollbars are always added, allowing users to scroll to see overflowing content auto Scrollbars appear only if ...

Read More

Usage of margin-right property with CSS

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

The CSS margin-right property specifies the right margin of an element. It controls the space between the element and adjacent elements or the container's edge on the right side. Syntax selector { margin-right: value; } Possible Values ValueDescription lengthDefines margin in px, em, rem, etc. %Defines margin as a percentage of parent element's width autoBrowser calculates the margin automatically Example 1: Using Length Values The following example demonstrates margin-right using pixel values − .container { ...

Read More

Create layers using CSS

Ankith Reddy
Ankith Reddy
Updated on 15-Mar-2026 90 Views

To create layers using CSS, you can control the stacking order of elements using the z-index property combined with positioned elements. This allows you to stack elements on top of each other and control which element appears in front. Syntax selector { position: relative | absolute | fixed | sticky; z-index: integer; } How Z-Index Works The z-index property only works on positioned elements (elements with position other than static). Higher z-index values appear on top of lower values. Z-Index ValueStacking Order Higher numbers ...

Read More

CSS min-width property

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

The CSS min-width property sets the minimum width that an element can have. This property ensures that an element will never become smaller than the specified minimum width, even if the content would normally make it narrower. Syntax selector { min-width: value; } Possible Values ValueDescription lengthDefines minimum width in px, em, rem, etc. %Defines minimum width as a percentage of the parent element autoDefault value; browser calculates the minimum width Example: Setting Minimum Width The following example demonstrates how min-width prevents an element from becoming ...

Read More

CSS max-height property

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

The CSS max-height property sets the maximum height that an element can reach. When content exceeds this maximum height, it will overflow or be clipped depending on the overflow property. Syntax selector { max-height: value; } Possible Values ValueDescription lengthA fixed height in px, em, rem, etc. percentageA percentage of the containing block's height noneNo maximum height limit (default) initialSets to default value inheritInherits from parent element Example: Text Content with Max Height The following example shows how max-height affects text content that exceeds the specified ...

Read More

CSS line-height property

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

The CSS line-height property is used to set the height of a line of text. It controls the spacing between lines of text within an element, affecting readability and visual appearance. Syntax selector { line-height: value; } Possible Values ValueDescription normalDefault value, usually around 1.2 times the font size numberA number multiplied by the font size (e.g., 1.5) lengthFixed length in px, em, rem, etc. %Percentage of the font size Example: Setting Line Height The following example demonstrates different line-height values applied to paragraphs − ...

Read More

CSS width property

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

The CSS width property is used to set the width of an element. It defines how wide an element should be, and can accept various types of values including lengths, percentages, or keywords. Syntax selector { width: value; } Possible Values ValueDescription autoBrowser calculates the width automatically (default) lengthDefines width in px, em, rem, cm, etc. %Defines width as a percentage of the parent element initialSets width to its default value inheritInherits width from the parent element Example: Setting Fixed Width The following example demonstrates setting ...

Read More

CSS height property

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

The CSS height property is used to set the height of an element. It determines how tall an element will be, and can accept various types of values including lengths, percentages, or keywords. Syntax selector { height: value; } Possible Values ValueDescription autoBrowser calculates the height automatically (default) lengthDefines height in px, em, rem, cm, etc. %Defines height as a percentage of the parent element initialSets the property to its default value inheritInherits the value from parent element Example: Setting Fixed Height The following example demonstrates ...

Read More
Showing 6671–6680 of 8,010 articles
« Prev 1 666 667 668 669 670 801 Next »
Advertisements