Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum limit of CSS classes that can be assigned to HTML element?

Tags:

html

css

How many number of CSS classes can be assigned for an HTML element.

like image 462
Ugesh Gali Avatar asked Sep 06 '10 06:09

Ugesh Gali


4 Answers

I don't think there's a limit. A quick Google search yielded this.

like image 76
janosrusiczki Avatar answered Oct 25 '22 09:10

janosrusiczki


The standard does not specify any limitation, but individual browsers may have practical ones.

like image 20
Matthew Flaschen Avatar answered Oct 25 '22 10:10

Matthew Flaschen


There are no such limitations imposed by the specification:

class

The attribute, if specified, must have a value that is a set of space-separated tokens representing the various classes that the element belongs to.

A set of space-separated tokens is a string containing zero or more words separated by one or more space characters, where words consist of any string of one or more characters, none of which are space characters.of which are space characters.

like image 45
Alan Haggai Alavi Avatar answered Oct 25 '22 10:10

Alan Haggai Alavi


I'm pretty sure IE6 only supports up to 2. Modern browers have no limit as far as i know.

like image 21
user1748622 Avatar answered Oct 25 '22 11:10

user1748622