Mobile app version of vmapp.org
Login or Join
Si4351233

: Difference between ":" and "=" in HTML and CSS? 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

@Si4351233

Posted in: #Css #Html

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.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Si4351233

2 Comments

Sorted by latest first Latest Oldest Best

 

@Cugini213

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

10% popularity Vote Up Vote Down


 

@BetL925

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).

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme