Showing posts with label css. Show all posts
Showing posts with label css. Show all posts

Monday, 3 September 2007

CSS is case sensitive

Never thought Cascaded Style Sheets will be case sensitive. After a long time of coding in VB, and ASP, using Visual Studio 2005; I was kind of accustomed to coding in whatever case I wanted and wait for the VS2005 to take care of the case. Lately I have been having this problem in viewing the image button, incorrectly. the problem was further aggreivated, when there were two similar buttons with one showing the background image and the other one completely blank. After about an hour of excercise, with the stylesheet, I found out that I was writing one as Jobs_Feature and the other one as Jobs_feature. Bingo! Probably a lesson learnt hard way, but then i prefer to learn it this way rather than keep on reading books and trying to memorize
the facts and features of the stuff.

Further research shows that if the doctype declaration in the start of HTML page is not defined as XML, then CSS does not mind the different case in the class name, but the moment we declare the XML doctype, it turns out to be case sensitive. So this property of CSS can be attributed to XML. If you remember, XML has a standard, wherein the case of the tags and filename should always match.

Changing style of Drop down list.

I have been trying to change the border setting for multiple selection drop down menu in ASP.NET. After a bit of testing, I realised that all the style sheet code was not being rendered to the drop down list, when viewed in Internet Explorer. Mozilla FireFox was good enough, and even Safari, did help me out, but it was IE that did not budge! Then googling it gave me following explanation why IE did not work as expected.

"For historical reasons, some form-elements are elements from the operating system’s GUI. Rendering of these elements differs from browser to browser. Most of the browser, take into consideration the style sheet information about the element, and if not present renders the default properties from the OS’s GUI. For IE unfortunately these elements are <select>, <checkbox> and <radio>."