Web Development Articles

Page 644 of 801

What are Floating List Items in CSS

seetha
seetha
Updated on 15-Mar-2026 678 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 331 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

Create a transparent box with CSS

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

Creating a transparent box in CSS allows you to make elements semi-transparent, revealing content behind them. The most common approach is using the opacity property, which controls the transparency level of an entire element. Syntax selector { opacity: value; } Possible Values ValueDescription 0Completely transparent (invisible) 0.1 - 0.9Semi-transparent (decimal values) 1Completely opaque (default) Example The following example demonstrates how to create transparent boxes with different opacity levels − div { ...

Read More

Set the opacity for the background color with CSS

varun
varun
Updated on 15-Mar-2026 283 Views

To set the opacity for the background color, use the RGBA color values or the opacity property. RGBA allows you to control the transparency of just the background, while the opacity property affects the entire element including text and child elements. Syntax /* Using RGBA for background opacity */ selector { background-color: rgba(red, green, blue, alpha); } /* Using opacity property */ selector { opacity: value; } Method 1: Using RGBA Values The RGBA color model allows you to specify opacity only for the background ...

Read More

Add transparency to the background with CSS

usharani
usharani
Updated on 15-Mar-2026 354 Views

The CSS opacity property is used to add transparency to the background of an element. The property accepts values from 0 (completely transparent) to 1 (completely opaque), allowing you to create various levels of transparency effects. Syntax selector { opacity: value; } Possible Values ValueDescription 0Completely transparent (invisible) 0.1 - 0.9Partially transparent with varying degrees 1Completely opaque (default) Example: Different Opacity Levels The following example demonstrates different transparency levels using the opacity property − div { ...

Read More

Role of CSS :visited Selector

varma
varma
Updated on 15-Mar-2026 260 Views

The CSS :visited selector is used to style links that have been visited by the user. This pseudo-class allows you to apply different styles to links based on whether they have been clicked before, providing visual feedback to users about their browsing history. Syntax a:visited { property: value; } Example: Basic Visited Link Styling The following example demonstrates how to style visited links with different colors and properties − a:link { color: ...

Read More
Showing 6431–6440 of 8,010 articles
« Prev 1 642 643 644 645 646 801 Next »
Advertisements