CSS Articles

Page 127 of 130

Using CSS z-index property

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

The CSS z-index property is used along with the position property to create an effect of layers. You can specify which element should come on top and which element should come at the bottom. Syntax selector { z-index: value; } Possible Values ValueDescription autoDefault value. Stack order is inherited from parent integerSets the stack order (higher values appear on top) Example: Layering Elements The following example demonstrates how to use z-index to control which element appears on top − ...

Read More

Fixed Positioning with CSS

Yaswanth Varma
Yaswanth Varma
Updated on 15-Mar-2026 404 Views

The CSS position: fixed property positions an element relative to the browser window (viewport). Unlike other positioning methods, fixed elements remain in the same position even when the page is scrolled, making them ideal for navigation bars, headers, or footers that should always be visible. Syntax selector { position: fixed; top: value; /* optional */ right: value; /* optional */ bottom: value; /* optional */ left: value; /* optional */ } ...

Read More

CSS positioning related properties

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

The positioning related properties in CSS allow you to control where elements appear on a webpage. CSS offers several positioning methods to place elements precisely where you want them. Syntax selector { position: value; top: value; right: value; bottom: value; left: value; } Position Property Values ValueDescription relativeElement is positioned relative to its normal position absoluteElement is positioned relative to its nearest positioned ancestor fixedElement is positioned relative to the viewport (browser window) ...

Read More

Usage of CSS visibility property

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

The CSS visibility property controls whether an element is visible or hidden. Unlike display: none, hidden elements with visibility: hidden still occupy space in the layout. Syntax selector { visibility: value; } Possible Values ValueDescription visibleThe element and its contents are shown to the user (default) hiddenThe element and its content are invisible, but still affect the page layout collapseUsed only with table rows and columns to remove them from display Example: Visible vs Hidden Elements The following example demonstrates how visibility: hidden hides elements while ...

Read More

Values of CSS overflow property

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 15-Mar-2026 149 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 154 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 249 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 80 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 84 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 170 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
Showing 1261–1270 of 1,299 articles
Advertisements