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 | DirectoryIterator valid() Function
- PHP | Imagick valid() Function
- PHP | SimpleXMLIterator valid() Function
- PHP | ArrayIterator valid() Function
- PHP | SplFixedArray valid() Function
- PHP | AppendIterator valid() Function
- PHP | SplObjectStorage valid() Function
- PHP | SplDoublyLinkedList 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 ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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