Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am very new to HTML and CSS but while learning I ran into something that I was curious about. How come when you want to style or change font size etc. you use :.

Example: style="color: red; font-size: 50px".

But when you want to link to let's say your stylesheet you use =.

Example: link type="text/css"; rel="stylesheet"; href="stylesheet.css".

What's the difference? Because basically when you say color: red, your saying you want the color to = red, so why not just use that? This is just a curiosity thing nothing serious but your answers are appreciated.

share|improve this question
up vote 2 down vote accepted

When you use :, it's CSS. When you use =, it's HTML. It's just two languages with each one has its own different method for assigning attributes (HTML) and properties (CSS).

share|improve this answer
Quick response, Thank you. Also thank you for editing my post I don't know how to make it look like that but I'll figure it out and make sure future post are easier to read. – TheFlyingByrd Feb 18 '14 at 21:29
No problem and welcome to Pro Webmasters. – Zistoloen Feb 18 '14 at 21:37
Neither HTML nor CSS has variables; they are not programming languages. HTML has attributes, CSS has properties. But it is indeed a matter of simple syntactic difference between the two languages. – Jukka K. Korpela Feb 18 '14 at 21:44
@Jukka K. Korpela: You're right, I have edited my answer. – Zistoloen Feb 19 '14 at 8:38

Each programming language has its syntax.

For HTML, styles' properties are defined by

property_name: property_value 

And also for HTML, markup properties are defined by

markup_name = markup_value
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.