+ 1
Why do HTML5 & CSS syntax vary?
I am a recent beginner programmer (2 weeks in) learning HTML5 & a little bit of CSS as well. Recently I have looked for websites to hone my skills however I seem to run into conflict as to how HTML5 &/or CSS should be written; &, simply Googling it does not help in reference to the syntax or language used. For example on w3schools.com, their style command version looks like this... <h1 style="font-family:Ariel;"> On another site, dash.generalassemb.ly, its <style> h1 { font-family:Ariel; } Why is that?
5 Answers
+ 4
they are same actually there are three ways to use CSS
<link rel=stylesheet href=path to general styles.css>
<style>
page specific styles
</style>
and <div styl=" inline CSS codes">
yes correct they do vary but this is not a variation
+ 4
I don't got you friend these all three ways are formal first ones is fetching CSS rules from external files the other to add style rules within a html page like sololearns and third our use in the special elements without adding style tags however it's not used for big classes as in dash. com for simple running.
+ 1
So I do not have to worry about a "specific" or [using a better term] "formal" way of writing the code?
+ 1
offcourse you should follow a standard way to write code.for css u should learn how to use external css files and changes should be in one file and later if any other programmer need to work on your file it should be easier to read and understand your code.indenting is the must..u should know how to indent code and follow..either other ppl can't work on your file.
0
Sorry, I do not mean to continue making trouble. That was the wrong site. The actual site is dash.generalassemb.ly/projects. But thank you, your answers were really helpful!