Doesn't CSS define presentation of web content?



Codecademy says that a markup language like HTML “defines structure and presentation of raw text”. Doesn’t CSS define the presentation of web content?


That is correct! These days HTML is best categorized as a descriptive markup language which encourages developers to focus on the semantic meaning of information rather than it’s visual appearance. However, there are other markup languages which make no such separation of concerns. In fact, HTML used to be more presentational before the advent of CSS.

On a related note, it is important to realize that most browsers have default styles which they will apply to certain HTML elements.

FAQ: Learn HTML Elements - Intro to HTML - What is HTML?

So, for clarity, as a layman…What the ■■■■ does that mean?


In its simplest terms. HTML is your skeleton with text, images, links etc forming a base/foundation of a webpage and CSS is your muscles, skin and clothing to make it more presentable with font style, font colours, image alignment, background colours etc.

If you want another example, if you build a house, the brickwork, plastering and foundations are HTML, the CSS is your external and interior decorating to jazz it up abit.

HTML can be used exclusively when designing a webpage, but you’re rather limited as to what you can tweak visually on a webpage. CSS released a few years after HTML had been out so until it was released a developer had to make do with the tools at their disposal. There can, in some instances, be blurred lines between the two langauges but it’s often encourged to use HTML as a foundation and CSS as your style.

There are other markup languages which I’m not going to go into, that can do both raw text and styling at the same time, but this can look messy and is not very beginner friendly which is why HTML and CSS are seen as the standard for starting out.

I hope this eases any confusion @bitplayer07282


So is HTML a place to store content and CSS is a how we make that content more presentable.


@rgurule Yes, although I wouldn’t say HTML is a “place” or use the word “store” because the storing is done elsewhere. I think just saying HTML is a way to write content while CSS is a way to format that content is more appropriate.


You mean “…rather than its visual appearance” - its in this case should not have an apostrophe. It’s with an apostrophe is reserved for the “it + is” conjunction. Its (no apostrophe) is the possessive of it, as in “its visual appearance”.