A Curious Mind
#tastic

Arrgghhhhhh JavaScript, Arrgghhhhhhh!!!! CSS

Thursday, October 19, 2006 6:11 PM

So I downloaded IE 7 today, fully knowing that a part of my app was getting hosed by it. So I have started to dive into the issues which are CSS and JS related, and I am hitting my head against a brick wall. @)#(*${) Well, i know that my JavaScript skills are much weaker than I want them to be so I think I will rewrite the few lines of JS in my app that I wrote in some of the newer styles and see if I can't unit test them as well, but that still leaves CSS.

For me CSS is the most Program by Coincidence stuff I work with. And for the life of me I can't figure out how to make it better. My hat is off to anyone that can make this stuff do what they want on each browser. I even tried downloading StyleMaster but I really didn't find it that helpful, it is better than notepad though.

So does anyone have any killer CSS ideas.

My wishlist (With some of these I have no idea if it would help or not but here they are.)

1. Improved scoping.

#navigation
{
    li
    {
        background:#a00;
    }
}

Which I see as being the same as

#navigation li
{
    background:#a00;
}

The big benefit of this would be with a lot of children statements of course.

2. Variables.

I am sure that they were just trying to keep things simple and yes I can just use server side processing to add variables, but can't we have them. Color manangement alone would be soooo much easier.

3. Everything else people want.

But who am I kidding. CSS is dificult enough for the browser people to get right, and the Standards people take forever to get anything together. These kinds of things are never going to happen. So CSS leaders tell me, what can I do.


Feedback

# re: Arrgghhhhhh JavaScript, Arrgghhhhhhh!!!! CSS

CSS is wonderful, what are you talking about!

Scoping and variables would be nice, but I'd rather just see IE catch up and start implementing some standards, such as attribute selectors. (for example, without touching the markup, how can you style a textbox and a button separately? in Safari/Firefox you can do this:
input[type="text"] { border: solid 1px blue; }
input[type="button"] { border: solid 1px red; }

cool, huh?
)

I agree that it can be difficult, but I read CSS Mastery by Andy Budd and I feel like I can take on most CSS problems on my own now... 10/19/2006 7:38 PM | Ben Scheirman

# re: Arrgghhhhhh JavaScript, Arrgghhhhhhh!!!! CSS

another awesome one is the pseudo selector :hover (which is supposed to be applicable on ANY element, not just A tags)

pretty neat to do this for your datagrids in firefox

tr:hover
{ background-color: #ffe; } 10/19/2006 7:39 PM | Ben Scheirman

# re: Arrgghhhhhh JavaScript, Arrgghhhhhhh!!!! CSS

CSS is wonderful, but its wonderfulness doesn't solve my problems. On top of this is that CSS is a complex concept combined with funky implementations by the browsers doesn't help the issue either. There may be techniques out there but nothing I have seen that will truely let me debug CSS selectors. All of this said doesn't defeat the fact that CSS could be made better. Ultimatly I would be very happy if IE and FireFox both had excellent support for CSS. But I still need help setting up more complex selectors. Maybe something that shows your DOM in HTML format and then lets you type in CSS selectors and it would hightlight the effected portions. 10/19/2006 7:48 PM | dru

Post a comment





 

Please add 8 and 6 and type the answer here: