CSS Data Type - <custom-ident> (2024)

  • Selected Reading
  • UPSC IAS Exams Notes
  • Developer's Best Practices
  • Questions and Answers
  • Effective Resume Writing
  • HR Interview Questions
  • Computer Glossary
  • Who is Who

'; var adpushup = adpushup || {}; adpushup.que = adpushup.que || []; adpushup.que.push(function() { adpushup.triggerAd(ad_id); });

CSS data type <custom-ident> represents a custom identifier. It is used to denote custom names or identifiers that developers define for certain CSS properties or values. This data type allows for a broader range of possibilities by enabling the use of custom names beyond the predefined keywords and standard identifiers.

Custom identifiers are typically used in situations where developers want to create and use their own naming conventions for certain aspects of styling or theming.

For example, in the context of CSS variables (custom properties), you might use <custom-ident> to represent a custom identifier for a variable name:

:root { --main-color: red;}.element { color: var(--main-color);}

In this example, --main-color is a custom identifier, and the var() function is used to reference the value stored in the custom property.

Forbidden Values

To prevent uncertainity, each property that uses <custom-ident> forbids the use of specific values as listed below:

  • animation-name − Global CSS values (unset, initial, inherit and none) are forbidden.

  • counter-reset, counter-increment − Global CSS values (unset, initial, inherit and none) are forbidden.

  • @counter-style, list-style-type − Global CSS values (unset, initial, inherit) are forbidden alongwith (none, inline, outside), as well as the values: disc, circle, square, decimal, cjk-decimal, decimal-leading-zero, lower-roman, upper-roman, lower-greek, lower-alpha, lower-latin, upper-alpha, upper-latin, arabic-indic, armenian, bengali, cambodian, cjk-earthly-branch, cjk-heavenly-stem, cjk-ideographic, devanagari, ethiopic-numeric, georgian, gujarati, gurmukhi, hebrew, hiragana, hiragana-iroha, japanese-formal, japanese-informal, kannada, katakana, katakana-iroha, khmer, korean-hangul-formal, korean-hanja-formal, korean-hanja-informal, lao, lower-armenian, malayalam, mongolian, myanmar, oriya, persian, simp-chinese-formal, simp-chinese-informal, tamil, telugu, thai, tibetan, trad-chinese-formal, trad-chinese-informal, upper-armenian, disclosure-open, disclosure-close.

  • grid-row-start, grid-row-end, grid-column-start, grid-column-end − The span value is forbidden.

  • view-transition-name − Global CSS values (unset, initial, inherit) are forbidden, as well as none.

  • will-change − Global CSS values (unset, initial, inherit), as well as the values (will-change, auto, scroll-position, and contents) are forbidden.

Syntax

The syntax for CSS <custom-ident> follows the same rules as CSS property names, except that it is case-sensitive. This element includes one or more characters, defined as any of the following:

  • Any alphabetical letter from A to Z or a to z.

  • Any decimal digit from 0 to 9.

  • The hyphen (-) character.

  • The underscore (_) character.

  • An escaped character is defined as a character that comes after a backslash (/).

  • A Unicode character represented by a backslash (/) followed by one to six hexadecimal digits.

Escaping characters

Unicode code points can be included in a <custom-ident> or quoted <string> by escaping them.

CSS provides various ways of escaping a character. Escape sequences begin with a backslash (\) and follow with:

  • Hexadecimal sequences of one to six digits (ABCDEF0123456789) can be optionally followed by white space. These sequences are replaced by the Unicode code point corresponding to the specified hex digits, with the whitespace allowing subsequent actual hex digits.

  • Any Unicode code point that is neither a hex number nor a newline character.

Examples:

  • "&B" can be represented as \26 B or \000026B.

  • "hi.there" can be represented as hi\.there or hi\002Ethere.

  • "toto?" can be written as toto\?, toto\3F, or toto\00003F.

Valid Identifier

The following syntax represents a combination of alphanumeric characters and digits −

tata59 A combination of alphanumeric characters and numbers.high-level A combination of alphanumeric characters and a dash-nest Alphanumeric characters are placed after a dash._external Alphanumeric characters are placed after a underscore.\11 nono A group of alphanumeric characters that follows a Unicode character.tili\.wow A correctly escaped period.

Invalid Identifier

The following syntax represents specific rules for representing values −

24rem It must not begin with a decimal digit.-16rad It cannot begin with a dash followed by a decimal digit.tili.wow The only characters that don't require escape are alphanumeric characters, _, and -.'tiliwow' This would be a <string>."tiliwow" This would be a <string>.

CSS <custom-ident> - animation-name

The following example demonstrates the use of animation-name property by defining @Keyframes -demoanimation. The hyphen(-) naming convention is attached to CSS syntax as custom identifier −

<html><head><style> @keyframes -demoanimation { 0% { transform: translateX(0); } 50% { transform: translateX(100px); } 100% { transform: translateX(0); } } .box { width: 100px; height: 100px; background-color: pink; animation-name: -demoanimation; animation-duration: 3s; animation-iteration-count: infinite; }</style></head><body> <div class="box"></div></body></html>

CSS <custom-ident> - counter-reset, counter-increment

The following example demonstrates the use of counter-reset property with the custom-identifier demo-counter and sets its initial value to 0. The counter-increment property increments the value of the counter each time −

<html><head><style> body { counter-reset: demo-counter; } p::before { content: counter(demo-counter); counter-increment: demo-counter; margin: 5px; }</style></head><body> <div> <p>First Paragraph</p> <p>Second Paragraph</p> <p>Third Paragraph.</p> </div></body></html>

Advertisem*nts

';adpushup.triggerAd(ad_id); });

CSS Data Type - <custom-ident> (2024)
Top Articles
Dr. med. Hoang-Dzung Nguyen - Lesen Sie Erfahrungsberichte und vereinbaren Sie einen Termin
Dr. No | Rotten Tomatoes
Knoxville Tennessee White Pages
Koopa Wrapper 1 Point 0
Goodbye Horses: The Many Lives of Q Lazzarus
Wellcare Dual Align 129 (HMO D-SNP) - Hearing Aid Benefits | FreeHearingTest.org
Craglist Oc
Wmu Course Offerings
Obituary (Binghamton Press & Sun-Bulletin): Tully Area Historical Society
The Best English Movie Theaters In Germany [Ultimate Guide]
ds. J.C. van Trigt - Lukas 23:42-43 - Preekaantekeningen
Employeeres Ual
What Does Dwb Mean In Instagram
United Dual Complete Providers
R/Afkarena
Hell's Kitchen Valley Center Photos Menu
Cinebarre Drink Menu
Wal-Mart 140 Supercenter Products
Candy Land Santa Ana
Arre St Wv Srj
Crawlers List Chicago
Finalize Teams Yahoo Fantasy Football
Nsa Panama City Mwr
What Are The Symptoms Of A Bad Solenoid Pack E4od?
Fleet Farm Brainerd Mn Hours
Craiglist.nj
Cardaras Funeral Homes
CVS Health’s MinuteClinic Introduces New Virtual Care Offering
Hobby Lobby Hours Parkersburg Wv
Trinket Of Advanced Weaponry
John Philip Sousa Foundation
Craigslist Boerne Tx
Ezstub Cross Country
In Branch Chase Atm Near Me
Compress PDF - quick, online, free
Jewish Federation Of Greater Rochester
Ksu Sturgis Library
Courses In Touch
2017 Ford F550 Rear Axle Nut Torque Spec
Peace Sign Drawing Reference
Elven Steel Ore Sun Haven
Iupui Course Search
Chubbs Canton Il
A Man Called Otto Showtimes Near Cinemark Greeley Mall
Anonib New
Zits Comic Arcamax
Spongebob Meme Pic
Free Carnival-themed Google Slides & PowerPoint templates
Sdn Dds
Tamilyogi Cc
Craigslist Charlestown Indiana
Latest Posts
Article information

Author: Tyson Zemlak

Last Updated:

Views: 5231

Rating: 4.2 / 5 (43 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Tyson Zemlak

Birthday: 1992-03-17

Address: Apt. 662 96191 Quigley Dam, Kubview, MA 42013

Phone: +441678032891

Job: Community-Services Orchestrator

Hobby: Coffee roasting, Calligraphy, Metalworking, Fashion, Vehicle restoration, Shopping, Photography

Introduction: My name is Tyson Zemlak, I am a excited, light, sparkling, super, open, fair, magnificent person who loves writing and wants to share my knowledge and understanding with you.