tags:

views:

90

answers:

6

Is knowledge of HTML beyond the basics a prerequisite for learning CSS?

I am making a learning plan so this will help me evaluate the time required better.

+3  A: 

Whats the use of CSS if you don't know HTML?

So better get a good understanding of HTML first and then study CSS.

rahul
You can use CSS on other things, e.g., on XML documents. It's a cheap way of turning machine-readable data into somewhat human-readable data. Of course, it's even better to XSLT to transform the XHTML, but that's getting away from the point.
Donal Fellows
+10  A: 

Is knowledge of HTML beyond the basics a prerequisite for learning CSS?

Absolutely. You won't be able to use CSS in a practical way if you don't know your way around the HTML elements to apply them to.

I'd say learn them both parallelly. Understand the basic HTML syntax and structure first; then start with CSS.

Pekka
+1  A: 

You can learn CSS from scratch, only basic HTML is needed to allow you to start! Good luck, w3schools.com is an excellent reference site and learning tool for HTML/CSS.

Tom Gullen
+1 for w3schools (HTML and CSS :)). You may find it's not all valid, however it's a great reference once you know what you're doing and where to fix their mistakes.
Sam
-1 for w3schools. It is error prone at best (HTML) and positively dangerous at worst (PHP: they seem to be competing for "most SQL injection vulnerabilities in one tutorial")
David Dorward
+1  A: 

Good question. I'd say technically speaking you don't really need to know HTML if you're absolutely only going to work in CSS (styling somebody else's HTML), but you do need to know about the DOM structure and box model. As pertains to CSS, the DOM and HTML are so closely related as to be virtually indistinguishable. If you know enough about the DOM structure to be able to code CSS, you pretty much automatically know HTML with it.

deceze
No, how can you style someone elses HTML if you don't even understand what a div or id is...HTML is easy, and it would be harder coding CSS without it than actually learning it. Besides, you would pick it up anyway :).
Sam
@Sam That's what I'm saying, you'd pick it up anyway. You can perfectly write CSS without having to look at HTML. In fact, you're not even styling HTML, you're styling **DOM elements**. DOM elements correspond 1:1 to your HTML (99%+ of the time), but they could just as well be generated by Javascript. I know it's a technicality, but it's true. ;)
deceze
+1  A: 

This almost like asking if you can be an interior decorator without knowing what a house is or the different kinds of rooms.

The whole point of CSS is to make HTML look (and sometimes act) better.

It would be silly to use CSS to create indented lists, and only then discover the <ul> tag.

Or worse, I've seen people spend weeks trying to use CSS to put data in a grid, when one simple <table> tag did the trick. ;-)

Brock Adams
+1  A: 

Its better if you will go with HTML first, anyways it won't take much time, atleast you should have a basic idea about HTML, then you can easily move in CSS. Anyways CSS is nothing but the style sheet.

Saurav Kumar