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?
LINK-
http://www.securehostserver.info/smokies/
| SitePoint Sponsor |




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?
LINK-
http://www.securehostserver.info/smokies/
Todd Temple > T2 Design


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.
Brilliant ideas, elegant execution.
Graphic Design, Art Direction, Copywriting and Web Design.





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?
LiveScript: Putting the "Live" Back into JavaScript
if live output_as_javascript else output_as_html end if


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.
More info on escaping css.Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Untitled Document</title> <style> div.\31{background:red} div.\32{background:blue} div.\33{background:yellow} div.\34{background:green} </style> </head> <body> <div class="1">test</div> <div class="2">test</div> <div class="3">test</div> <div class="4">test</div> </body> </html>
www.pmob.co.uk CSS FAQ 3 col demo Read My CSS Articles
Ultimate CSS Reference
Check out SitePoint's latest JavaScript challenge





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.
LiveScript: Putting the "Live" Back into JavaScript
if live output_as_javascript else output_as_html end if
Bookmarks