Page 1 of 1
div#name or div #name or div id="name" ????
Posted: Tue Nov 04, 2014 5:33 pm
by KitchM
What is the consensus for best practices for naming?
There appears to be various methods, and the one that CMSMS templates use is div#name that the syntax highlighter does not like.
Choices:
1. div#name
2. div #name
3. div id="name"
4. other?
Thanks.
Re: div#name or div #name or div id="name" ????
Posted: Tue Nov 04, 2014 6:35 pm
by JohnnyB
Naming is kind of a personal thing when it comes to HTML/CSS
When participating on a team, and mostly with backend code, there will be standards established.
1. div#name
2. div #name
In css, this would not be the same target.
div#MyTitle is not the same as
div #MyTitle
1) is <div id="MyTitle">Title</div>
2) is <div><p id="MyTitle">Title</p></div>
OR
<div><div id="MyTitle">Title</div></div>
OR
<div><h1 id="MyTitle">Title</h1></div>
https://generalassemb.ly/education/code ... ash-course
https://mozteach.makes.org/thimble/cras ... ml-and-css
Re: div#name or div #name or div id="name" ????
Posted: Tue Nov 04, 2014 10:24 pm
by KitchM
Why is number 1 used if the AceEditor doesn't like it? Or is it the problem of AceEditor?
Re: div#name or div #name or div id="name" ????
Posted: Wed Nov 05, 2014 2:40 pm
by Dr.CSS