todd_temple — 2012-08-20T12:20:51-04:00 — #1
I am trying to have three columns of text inside the DIV main-content. I added a class named "3col" with the properties of float: left; width: 200px; but it doesn't work. Any ideas why?
dresden_phoenix — 2012-08-20T13:44:59-04:00 — #2
Simple. CSS identfiers( classes or IDs) may NOT begin with numbers. change your class name to "cols_3" and you will see it work, for example. Hope that helps.
markdidj — 2012-08-20T14:35:04-04:00 — #3
Sorry to butt in, but any idea why that is dresden? It's not just CSS either, it seems to be in other scripting languages as well. I wanted to reference my 3D maze by "3d" but came up with so many errors that I changed it to "threed"
Why does a string not work if it starts with an int but will if it contains one? Is there a reason?
paulob — 2012-08-21T08:27:35-04:00 — #4
HTML5 allows ids to start with an integer although in css you would need to escape them to make it work.
As a matter of interest presently classnames in html can begin with a digit and you can do something like this which is valid html and cssa and works back to IE6.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
More info on escaping css.
markdidj — 2012-08-21T13:41:05-04:00 — #5
Wow, thanks Paul
I did have a think why. I suppose it's quicker to interpret and throw an error rather than check the following characters to make sure it's either an int or string.