Found 1566 Articles for CSS

Toggle class by adding the class name when element is clicked and remove when clicked outside

Shubham Vora
Updated on 21-Apr-2023 16:23:03

5K+ Views

Sometimes, we need to highlight the HTML element when we click it and make it normal when we click outside the HTML element. We can achieve it by toggling the class in the element. Here, the meaning of the toggling class is adding and removing the class. In this tutorial, we will learn to add the class name to the element when users click the element and remove the class name from the element when users click outside the element. Using the Add() and Remove() Method to Toggle Class When Clicking Inside and Outside of the Element In JavaScript, add() ... Read More

Snowfall Animation Effect using CSS

Shubham Vora
Updated on 21-Apr-2023 16:21:45

413 Views

We can create an animation using HTML and CSS. When we add animation to the webpage, it improves the UX of the application. We can create various animations using the CSS keyframes property and use it using the ‘animation’ CSS property. In this tutorial, we will learn to create a snowfall animation effect using CSS. Syntax Users can follow the syntax below to create a snowfall animation effect using CSS. .snow{ animation: snow 7s linear infinite; } .snow:nth-child(2) { left: 20%; animation-delay: 1s; } In the above syntax, ... Read More

How to Make Scrollbar Custom Arrows Work on Mobile Devices?

Yaswanth Varma
Updated on 20-Apr-2023 17:23:45

1K+ Views

You may have noticed websites with distinctive scrollbars that give them a unique feel and appearance since custom scrollbars are becoming more and more common. A custom scrollbar can simply be implemented in a few different ways. The easiest method will be used in this article, which is CSS. We employ CSS to enhance the visual appeal of web pages in our applications. Using CSS, we can now change how the scrollbar looks. Let’s see how to make scrollbar custom arrows work on mobile devices. Making scrollbar custom arrows work on mobile devices Back in the day, scrollbars on websites ... Read More

How To Create A Text Inside A Box Using HTML And CSS

Yaswanth Varma
Updated on 02-Jul-2024 16:47:09

16K+ Views

To create a text inside a box using HTML and CSS, we will be understanding most commonly used approaches in this article. We are having a element, inside that element we will have element. We need to to place some charecter of the p element inside a box, or create a border surrounded those charecters. Approaches to Create a Text Inside a Box Using span element with CSS Using CSS flexbox Creating a Text inside a Box Using span Element To create a text inside a box using ... Read More

How to Make a Shape Like On Image in Pure CSS?

Yaswanth Varma
Updated on 20-Apr-2023 16:29:26

813 Views

We can avoid having everything in our designs look like a box by using clipping in CSS. You can design a clip path and the shape you want to display on the webpage by utilizing a variety of basic shapes or an SVG. Web page elements are all defined inside of a rectangular box. But that doesn't mean that everything must have a box-like appearance. Using the CSS clip-path property, you can remove specific portions of an image or other element to produce eye-catching effects. Let’s dive into the article for getting better understanding on making a shape like on ... Read More

How to Get this Text-Wrapping Effect With HTML/CSS?

Yaswanth Varma
Updated on 20-Apr-2023 14:36:16

642 Views

Utilizing the CSS word-wrap property, large words are broken up and wrapped onto the following line. When an unbreakable string exceeds the length of the contained box, this feature is utilized to avoid overflow. This attribute specifies where a word should break when it becomes too long for the container, preventing overflow. When the content goes above the boundary of the container, it specifies how the words should be broken. Syntax Following is the syntax for text-wrapping word-wrap: normal | break-word | initial l inherit ; For getting better understanding on how to get this text-wrapping effect with HTML/CSS, ... Read More

How to style a select dropdown with only CSS?

Tapas Kumar Ghosh
Updated on 10-May-2023 11:13:20

246 Views

The website navigation plays an important role while building the website because it contains the dropdown list. The collection of various lists that exists in one or more navigation is called a dropdown list. To create the dropdown list it needs the select and option element. The option element is used under the select element which collects the list of various types like products, subjects, courses, etc. In this article, we are going to design the select dropdown with only CSS. Syntax option1 option1 The select element is used to ... Read More

Difference between CSS and JavaScript

Pradeep Kumar
Updated on 19-Apr-2023 17:22:08

2K+ Views

A website is developed using HTML. HTML is the backbone and provides the skeleton for the website. But using HTML alone, we can’t create our desired website. Cascade styling sheets is another language that adds another layer to the website. It applies formatting to the website, changes the layout of the website and makes the website appear beautiful. JavaScript is a programming language that makes a website functionable. It adds animations, pop up screens and a lot more to interact with the user. What is CSS? CSS stands for Cascading Style Sheets. CSS is a language which is used ... Read More

Which table property specifies the width that should appear between table cells in CSS?

Shubham Vora
Updated on 19-Apr-2023 14:27:27

410 Views

In HTML, a table contains columns and rows. The table cells don’t contain the space between two cells by default. If we add some space between table cells, it can improve the UI of the table. In CSS, the ‘border-spacing’ property adds the space between the table space. Also, we need to use the ‘border-collapse’ CSS property with the ‘separate’ value while using the ‘border-spacing’ CSS property. Syntax Users can follow the syntax below to use the ‘border-spacing’ CSS property to add spaces between the table cells. table { border-collapse: separate; border-spacing: 3rem; ... Read More

Which property specifies the width of a border in CSS?

Shubham Vora
Updated on 19-Apr-2023 14:25:57

137 Views

In CSS, the ‘border’ property is used to apply the border to any HTML element, such as div. Also, we can set the different styles for the border, color, width, etc. In this tutorial, we will learn different approaches to set the width of the border of the element. Also, we will learn to set the width of different sides of the element. Use the border-width CSS property to set the width of the border The ‘border-width’ CSS property is used to define the width of the border. Users can pass the four values to set the width ... Read More

Advertisements