I have been trying to learn CSS for a while now.

I have been working in C++ for quite some time now so i thought hey CSS should be a walk in a park but it has proved to be enormously difficult for me.

The main thing that seem to perplex me is the lack of clarity and absence of rigid C style rules in CSS. I mean i can't seem to grasp that what thing is suppose to do what ?

One thing seem to behave in a different ways in every context and often having huge and very unexpected variations.

I have been trying to learn CSS for the missing manuals series and those lynda videos.

Does anybody else has this problem. Share ur experiences.

Recommended Answers

All 4 Replies

A couple complicating factors for programmers (as opposed to coders). Each browser has it's own quirks, and CSS has an order requirement that isn't as well documented as it needs to be.

The biggest thing to remember is that an external stylesheet is rendered from top to bottom, which means that if you have two conflicting styles for the same element (say #main p versus vs p, the latter one wins, even if it doesn't look like they should be conflicting.

And I know from experience that's a tough one to get your head around.
A big help (in Firefox) is the Firebug addon. In MSIE, developer tools is a great help. Both will show which what styles are being applied and in what order.

Well first of all #main p is a specificity thing. Meaning anything with and ID of #main followed by a P tag will be affected. The hard thing for most backend developers to get around is that there is not much "logic" in css. The trick is really understanding the "box model" and browsers. I first started playing with CSS back in 2000 when it was barely supported and have been a css developer since. Just takes time and experience.

yeah, css can seem to be complicated, because there are so many ways to do things, and different coders do it differently, and many are very sloppy. so if you put it all together, it's a bit confusing.

As a C++ coder, all you need to know are the core foundations of css. i would suggest to go to a bookstore and get a very simple CSS book. like 100 pages or less, learn CSS in like 30 minutes, etc.. Learn the basic structure, and you'll be set. leave the advanced and complicated css to a css pro (outsource it if you need to). the basic CSS structure will look fine across platforms and browsers; it's only when you get advanced and compliated css styles, that it takes it to another level of confusion.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.