Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Front End Technology Articles
Page 461 of 652
Which characters are valid in CSS class names/selectors?
In CSS, class names and selectors are used to target specific HTML elements for styling. Understanding the rules for valid CSS class names is essential for writing clean, maintainable stylesheets. This tutorial covers all the important rules and valid characters for creating CSS class names. Rules for Valid CSS Class Names Here are the essential rules for creating CSS class names − Rule 1 − Class names should contain only alphanumeric characters (a-z, A-Z, 0-9), hyphens (-), and underscores (_). Rule 2 − Class names cannot start with digits. For example, 123test is invalid. Rule 3 ...
Read MoreTransition shorthand with multiple properties in CSS?
We can add transitions to HTML elements using CSS. Before we start with the tutorial, let's understand what transition is. Basically, the transition is an element changing from one state to another state. For example, we change the dimensions of the element when users hover over the element. In CSS, we can add transitions to elements using two ways. First is to use 'transition-property', 'transition-duration', 'transition-timing-function', and 'transition-delay' all 4 properties together. The second is using only the 'transition' CSS property. The CSS 'transition' property is shorthand for the below CSS properties. Transition-property − It specifies ...
Read MoreToggle class by adding the class name when element is clicked and remove when clicked outside
Sometimes, we need to highlight an HTML element when we click it and return it to its normal state when we click outside the element. We can achieve this by toggling CSS classes on the element − adding a class when clicked and removing it when clicked elsewhere. In this tutorial, we will learn to add a class name to an element when users click it and remove the class name when users click outside the element. Syntax element.addEventListener('click', function() { element.classList.add('className'); }); document.addEventListener('click', function(event) { if ...
Read MoreSnowfall Animation Effect using CSS
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 .snow { animation: snow 7s linear infinite; } .snow:nth-child(2) { left: 20%; animation-delay: 1s; } @keyframes snow { 0% { transform: translateY(-100vh); ...
Read MoreHow to Make Scrollbar Custom Arrows Work on Mobile Devices?
Custom scrollbars can enhance the visual appeal of your website by providing a unique user experience. While modern browsers support custom scrollbar styling through WebKit CSS properties, making these work consistently across mobile devices requires specific techniques. Syntax ::-webkit-scrollbar { width: value; } ::-webkit-scrollbar-thumb { background: color; } ::-webkit-scrollbar-track { background: color; } WebKit Scrollbar Properties PropertyDescription ::-webkit-scrollbarStyles the overall scrollbar element ::-webkit-scrollbar-thumbStyles the draggable part of the scrollbar ::-webkit-scrollbar-trackStyles the background track of the scrollbar ::-webkit-scrollbar-buttonStyles the arrow buttons on ...
Read MoreHow To Create A Text Inside A Box Using HTML And CSS
To create a text inside a box using HTML and CSS, we can use several approaches to add borders around text elements and create visually appealing boxed content. Syntax selector { border: width style color; padding: value; } Approaches to Create a Text Inside a Box Using span element with CSS Using CSS flexbox Method 1: Using Span Element with CSS Border This method uses a element with CSS border and padding properties ...
Read MoreHow to Make a Shape Like On Image in Pure CSS?
Creating custom shapes in CSS allows you to break free from the traditional rectangular box model. You can use the CSS clip-path property along with various shape functions to create visually appealing designs that clip portions of elements to form different shapes. Syntax selector { clip-path: shape-function(parameters); } Using Border Radius for Organic Shapes You can create irregular shapes by applying different border radius values to each corner of an element − .organic-shape { ...
Read MoreHow to Get this Text-Wrapping Effect With HTML/CSS?
The CSS word-wrap property allows long words to be broken and wrapped onto the next line when they exceed the width of their container. This prevents text overflow and ensures content remains within the designated boundaries. Syntax selector { word-wrap: normal | break-word | initial | inherit; } Possible Values ValueDescription normalWords break only at normal break points (default) break-wordAllows unbreakable words to be broken initialSets to default value inheritInherits from parent element Example 1: Text Wrapping Around Images The following example demonstrates text wrapping around ...
Read MoreWhich table property specifies the width that should appear between table cells in CSS?
In HTML, a table contains columns and rows. The table cells don't contain 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 space between table cells. We need to use the border-collapse CSS property with the separate value while using the border-spacing CSS property. Syntax table { border-collapse: separate; border-spacing: value; } Possible Values ValueDescription lengthSpecifies spacing in px, em, rem, etc. length lengthFirst value ...
Read MoreWhich property specifies the width of a border in CSS?
In CSS, the border-width property specifies the width of a border. You can set uniform width for all sides or specify different widths for each side of an element. Syntax border-width: value; border-width: top right bottom left; border-width: top-bottom left-right; Method 1: Using border-width Property The border-width CSS property allows you to define the width of borders. You can pass one to four values to control different sides − Example: Uniform Border Width The following example sets a 5px border width for all four sides ? ...
Read More