It is very easy to choose a valid class name or selectors in CSS just follow the rule.
- A valid name should start with an underscore (_), a hyphen (-) or a letter (a-z)/(A-Z) which is followed by any numbers, hyphens, underscores, letters.
- It cannot start with a digit, starting with the digit is acceptable by HTML5 but not acceptable by CSS.
- Two hyphens followed by a number is valid.
Example 1: This example describes the list of valid id selectors using CSS.
Example 2: This example describes the list of valid class selectors using CSS.
- How to find the parent class name with known class in jQuery ?
- CSS | : valid Selector
- PHP | SimpleXMLIterator valid() Function
- PHP | SplObjectStorage valid() Function
- PHP | SplFixedArray valid() Function
- What are valid values for the id attribute in HTML?
- Code valid in both C and C++ but produce different output
- How to override the CSS properties of a class using another CSS class ?
- How to get the last n characters of a PHP string?
- PHP | Different characters in the given string
- How to remove non-alphanumeric characters in PHP?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : ManasChhabra2