CSS Articles

Page 20 of 130

How to create Paradoxical effect using CSS?

Riya Kumari
Riya Kumari
Updated on 15-Mar-2026 674 Views

The Paradoxical effect is a visual effect used to create optical illusions where elements appear to move or behave in contradictory ways. This effect can add interesting and unique elements to your web pages by using CSS properties that create unexpected visual behaviors. This can be easily achieved using HTML and CSS combinations. In this article, we will explore techniques for creating paradoxical effects using CSS properties that work against each other, resulting in visually intriguing contradictions and animations. Syntax selector { property1: value1; property2: contradictory-value; ...

Read More

How to apply multiple transform property to an element using CSS?

Riya Kumari
Riya Kumari
Updated on 15-Mar-2026 5K+ Views

The CSS transform property allows you to apply multiple transformations to an element simultaneously. You can combine different transform functions like rotate(), scale(), and translate() to create complex visual effects. Syntax selector { transform: function1(value) function2(value) function3(value); } Method 1: Multiple Transform Functions in Single Declaration The most efficient way to apply multiple transformations is by combining transform functions in a single declaration separated by spaces − Example This example applies rotation and scaling transformations on hover − ...

Read More

How to align flexbox columns left and right using CSS?

Riya Kumari
Riya Kumari
Updated on 15-Mar-2026 22K+ Views

To align flexbox columns left and right using CSS, we can use various flexbox properties. In this article, we will learn three different approaches to align flexbox columns left and right using CSS. Syntax /* Method 1: Using justify-content */ .container { display: flex; justify-content: flex-start | flex-end | space-between; } /* Method 2: Using margin */ .item { margin-left: auto; /* Push to right */ margin-right: auto; /* Push to left */ } Method 1: Using justify-content ...

Read More

What is the use of star-preceded property in CSS?

Riya Kumari
Riya Kumari
Updated on 15-Mar-2026 460 Views

In web development, CSS (Cascading Style Sheets) enables developers to control the visual appearance and layout of websites. However, different web browsers have varying levels of CSS support, which can result in inconsistent rendering across different platforms. To overcome compatibility issues, developers historically used CSS hacks to ensure consistent display across browsers. The star-preceded property (or star property hack) was one such technique used to target specific versions of Internet Explorer that had limited CSS support. Syntax selector { property: value; /* Standard property for ...

Read More

How to specify that an input element should be disabled?

Tarun Singh
Tarun Singh
Updated on 15-Mar-2026 5K+ Views

When building forms on webpages, you sometimes need to disable input fields to prevent user interaction. This is useful for preventing users from accessing certain fields until previous steps are completed, or to avoid invalid data submission. CSS provides the :disabled pseudo-class and attribute selector to style disabled input elements, making it clear to users that these fields are not interactive. Syntax input:disabled { /* styles for disabled inputs */ } input[disabled] { /* alternative selector */ } Method 1: Using HTML disabled Attribute with ...

Read More

How to select “last child” with a specific class using CSS?

Tarun Singh
Tarun Singh
Updated on 15-Mar-2026 8K+ Views

To select the last child with a specific class using CSS is a simple process using CSS pseudo-class selectors. In this article, we will explore three different approaches to target the last element with a specific class. Syntax /* Using :last-child */ .class-name:last-child { property: value; } /* Using :nth-last-child() */ .class-name:nth-last-child(1) { property: value; } /* Using :last-of-type */ .class-name:last-of-type { property: value; } Method 1: Using :last-child Selector The CSS :last-child pseudo-class selector targets the last element inside ...

Read More

How to secure cascading style sheets?

Tarun Singh
Tarun Singh
Updated on 15-Mar-2026 840 Views

Web development heavily relies on Cascading Style Sheets (CSS) for styling and layout. However, CSS can be vulnerable to security threats that attackers exploit to inject malicious code, steal sensitive information, or perform other harmful activities. This article covers essential techniques to secure your CSS and protect your web applications from potential attacks. Syntax Secure CSS implementation involves multiple layers of protection − /* Secure CSS practices */ selector { property: secure-value; } /* Avoid external URLs in CSS */ /* Validate all user-generated content */ /* Use Content Security Policy ...

Read More

How to style a href links in React using Tailwind CSS?

Tarun Singh
Tarun Singh
Updated on 15-Mar-2026 1K+ Views

React is a popular JavaScript library for building user interfaces. When creating React applications, styling components is crucial for creating visually appealing interfaces. Tailwind CSS is a utility-first CSS framework that provides pre-built classes for rapid UI development. In this article, we will learn how to style anchor tags (href links) in React using Tailwind CSS with different approaches and utility classes. Installation Requirements: To follow along with the examples, you need to include Tailwind CSS in your HTML file. We'll be using the CDN approach for simplicity in our demonstrations. Syntax Link ...

Read More

How to create a Share Button with different Social Handles using HTML and CSS?

Riya Kumari
Riya Kumari
Updated on 15-Mar-2026 10K+ Views

To create share buttons with different social handles using HTML and CSS, we use basic CSS properties and HTML tags along with Font Awesome icons for professional-looking social media buttons. In this article, we will create share buttons for Facebook, Twitter, LinkedIn, Pinterest, Reddit, and WhatsApp with their respective brand colors and hover effects. Syntax button { background-color: brand-color; border: 1px solid brand-color; border-radius: radius; color: white; padding: value; } button:hover { ...

Read More

4 Different Ways to Center an Element Using CSS

Riya Kumari
Riya Kumari
Updated on 15-Mar-2026 391 Views

When designing a webpage or document, it's important to ensure that elements are visually balanced and positioned correctly. One common task in web development is to center an element within its container. While it may seem like a simple task, there are multiple ways to achieve this using CSS. In this article, we will explore four different methods for centering elements using CSS. We'll cover techniques using text-align, margin, Flexbox, and CSS Grid, and discuss the pros and cons of each method. Whether you're new to web development or looking to improve your skills, mastering these techniques will help ...

Read More
Showing 191–200 of 1,299 articles
« Prev 1 18 19 20 21 22 130 Next »
Advertisements