CSS Articles

Page 103 of 130

Role of CSS position: sticky;

varma
varma
Updated on 15-Mar-2026 304 Views

The CSS position: sticky property creates elements that behave as relatively positioned until they reach a specified scroll position, then become fixed. This is particularly useful for creating navigation bars that stick to the viewport when scrolling. Syntax selector { position: sticky; top: value; } Key Properties PropertyDescription position: stickyMakes the element sticky when scrolling topDistance from top of viewport where element becomes fixed z-indexStacking order (optional) Example: Sticky Navigation Bar The following example creates a navigation bar that sticks to the ...

Read More

Arrow to the bottom of the tooltip with CSS

Nancy Den
Nancy Den
Updated on 15-Mar-2026 901 Views

In CSS, you can create a tooltip with an arrow pointing to the bottom by using the ::after pseudo-element to generate a triangular shape. This is achieved by manipulating border properties to create the arrow effect. Syntax .tooltip .tooltip-text::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -border-width; border-width: size; border-style: solid; border-color: tooltip-color transparent transparent transparent; } Example The ...

Read More

How to add link dividers in a Navigation Bar with CSS

George John
George John
Updated on 15-Mar-2026 2K+ Views

Link dividers in navigation bars help separate menu items visually, making the navigation cleaner and more readable. You can add dividers using CSS border properties. Syntax li { border-right: width style color; } Example: Vertical Dividers with Border-Right The following example uses the border-right property to add vertical dividers between navigation items − ul { list-style-type: none; margin: 0; ...

Read More

Float List Items to the right with CSS

Daniol Thomas
Daniol Thomas
Updated on 15-Mar-2026 3K+ Views

The CSS float: right property allows you to align list items to the right side of their container. This is commonly used for creating navigation menus where some items appear on the left and others on the right. Syntax li { float: right; } Example: Floating List Items to the Right The following example demonstrates how to float specific list items to the right while keeping others on the left − ul ...

Read More

What are Floating List Items in CSS

seetha
seetha
Updated on 15-Mar-2026 661 Views

Floating list items in CSS allow you to create horizontal navigation bars and multi-column layouts by making list items flow side by side instead of stacking vertically. The float property removes elements from the normal document flow and positions them to the left or right of their container. Syntax li { float: left | right | none; } Possible Values ValueDescription leftFloats the element to the left side rightFloats the element to the right side noneDefault value, no floating applied Example: Horizontal Navigation Bar The following ...

Read More

Create a Horizontal Navigation Bar with CSS

George John
George John
Updated on 15-Mar-2026 4K+ Views

To create a horizontal navigation bar with CSS, you need to change the default vertical display of list items to horizontal. The key is using display: inline or display: inline-block on the elements to arrange them side by side. Syntax li { display: inline; } /* Or for more control */ li { display: inline-block; } Method 1: Using Display Inline The following example creates a basic horizontal navigation bar using display: inline − ...

Read More

What are Inline List Items in CSS

Sreemaha
Sreemaha
Updated on 15-Mar-2026 3K+ Views

Inline list items in CSS are created by setting the display property to inline for list elements (). This transforms vertically stacked list items into horizontally arranged elements, making them perfect for creating navigation bars and horizontal menus. Syntax li { display: inline; } Example: Creating a Horizontal Navigation Bar The following example demonstrates how to create a horizontal navigation bar using inline list items − ul { list-style-type: none; ...

Read More

Set a border around navbar with CSS

Chandu yadav
Chandu yadav
Updated on 15-Mar-2026 9K+ Views

To set a border around navbar with CSS, is an easy task and can be easily achieved using CSS properties. In this article, we will learn three different approaches for setting a border around navbar with CSS. Syntax /* Using border property */ .navbar { border: width style color; } /* Using outline property */ .navbar { outline: width style color; } /* Using box-shadow property */ .navbar { box-shadow: 0 0 0 width color; } Method 1: Using border Property ...

Read More

Set all the top border properties in one declaration using CSS

varun
varun
Updated on 15-Mar-2026 317 Views

The CSS border-top property is used to set all the top border properties in one declaration. This shorthand property combines border-top-width, border-top-style, and border-top-color into a single property. Syntax selector { border-top: width style color; } Possible Values ValueDescription widthSets the width of the top border (thin, medium, thick, or length units) styleSets the style of the top border (solid, dashed, dotted, etc.) colorSets the color of the top border (color name, hex, rgb, etc.) Example: Basic Border Top Declaration The following example demonstrates how to ...

Read More

Set style to current link in a Navigation Bar with CSS

Giri Raju
Giri Raju
Updated on 15-Mar-2026 2K+ Views

To set a style to the current link in a navigation bar, you need to add an active class to the current page link and define CSS styles for it. This helps users identify which page they are currently viewing. Syntax .active { background-color: color; color: text-color; /* other styling properties */ } Example The following example demonstrates how to style the current link in a navigation bar − ul { ...

Read More
Showing 1021–1030 of 1,299 articles
« Prev 1 101 102 103 104 105 130 Next »
Advertisements