CSS Articles

Page 63 of 130

How to create a Hero Image with CSS?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 463 Views

A hero image is a large, prominent image placed at the top of a webpage to grab visitors' attention. It typically includes overlay text and call-to-action buttons to engage users immediately. Syntax .hero-container { background-image: url('image-url'); height: 100vh; background-position: center; background-repeat: no-repeat; background-size: cover; position: relative; } Example The following example creates a full-screen hero image with overlay text and a call-to-action button − ...

Read More

How to add a form to a full-width image with CSS?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 425 Views

We can easily add a form on a web page. With that, a form can also be added to an image with CSS. In this tutorial, a form will be added to a full-width image with CSS. Let us see how. Syntax .container { background-image: url("image.jpg"); background-size: cover; position: relative; } .form { position: absolute; /* positioning values */ } Set the Styles for the Web Page To begin, set the height, margin ...

Read More

How to create a full-page background image with CSS?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 689 Views

Creating a full-page background image with CSS allows you to display an image that covers the entire viewport. This technique is commonly used for hero sections, landing pages, and creating immersive visual experiences. Syntax .background { background-image: url('image-url'); background-size: cover; background-position: center; background-repeat: no-repeat; height: 100vh; } Key Properties PropertyValueDescription background-sizecoverScales image to cover entire container background-positioncenterCenters the image in the container background-repeatno-repeatPrevents image from repeating height100vhSets height to full viewport ...

Read More

How to create an image with a transparent background text using CSS?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 710 Views

We can create an image with transparent background text by overlaying text content on an image using CSS positioning and background transparency. This technique uses a semi-transparent background color with the rgba() function to create an overlay effect that makes text readable while keeping the background image visible. Syntax .text-overlay { background: rgba(red, green, blue, alpha); position: absolute; } Method 1: Bottom Overlay Text This approach positions the text overlay at the bottom of the image with a transparent background − ...

Read More

How to add visual effects to images with CSS?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 543 Views

The CSS filter property is used to apply visual effects to images such as blur, brightness, contrast, drop shadow, grayscale, and more. This property allows you to enhance or modify the appearance of images directly through CSS without needing image editing software. Syntax selector { filter: none | blur() | brightness() | contrast() | drop-shadow() | grayscale() | hue-rotate() | invert() | opacity() | saturate() | sepia() | url(); } Common Filter Effects Filter FunctionDescriptionValues blur()Applies blur effectpx values (e.g., 5px) brightness()Adjusts brightness0% to 100%+ (100% = normal) contrast()Adjusts ...

Read More

How to create an image overlay zoom effect on hover with CSS?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 894 Views

The image overlay zoom effect on hover creates a smooth animation where a colored overlay scales up when the mouse cursor hovers over an image. This effect uses the :hover selector combined with CSS transforms and transitions to create an engaging visual interaction. Syntax .container:hover .overlay { transform: scale(1); transition: transform duration ease-function; } HTML Structure First, create a container with an image and overlay div ? Caption Text ...

Read More

How to create image overlay hover effect with CSS?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 1K+ Views

The image overlay effect on hover is hidden when the page loads and becomes visible when the mouse cursor is hovered over the image. The smooth transition effect is achieved using the CSS transition property combined with opacity and position properties. Syntax .overlay { transition: duration ease; opacity: 0; position: absolute; } .container:hover .overlay { opacity: 1; } Method 1: Basic Overlay with Text This method creates a simple text overlay that appears centered over the image ...

Read More

How to create a tabbed image gallery with CSS and JavaScript?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 833 Views

A tabbed image gallery allows users to click on small thumbnail images to view them in a larger format. This creates an interactive way to display multiple images without taking up too much page space initially. Let us see how to create a tabbed image gallery using CSS and JavaScript. Syntax /* Basic thumbnail styling */ .thumbnail { cursor: pointer; transition: transform 0.3s; } /* Modal container */ .modal { display: none; position: fixed; z-index: 1000; ...

Read More

How to create a responsive Image Grid with HTML and CSS?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 5K+ Views

A responsive image grid displays images in a grid layout that adapts to different screen sizes. Using CSS flexbox, we can create a flexible grid system that automatically adjusts the number of columns based on the viewport width. Syntax /* Outer grid container */ .outer-grid { display: flex; flex-wrap: wrap; } /* Inner grid columns */ .inner-grid { flex: percentage; max-width: percentage; } /* Responsive breakpoints */ @media screen and (max-width: breakpoint) { /* Responsive ...

Read More

How to create a modal image gallery with CSS and JavaScript?

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

A modal image gallery allows users to view thumbnail images and click on them to open a larger version in a modal overlay. This creates an elegant way to showcase multiple images without cluttering the page layout. Syntax /* Modal container */ .modal { display: none; position: fixed; z-index: 1; background-color: rgba(0, 0, 0, 0.9); } /* Modal image */ .modalImage { display: block; margin: auto; } Example The ...

Read More
Showing 621–630 of 1,299 articles
« Prev 1 61 62 63 64 65 130 Next »
Advertisements