View Single Post
Old 10-11-2021, 09:42 AM   #17
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,361
Karma: 20212223
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by Ghitulescu View Post
I'm not seeing how this link answers the question??

My question was:
Quote:
I have seen css using "id" tags to define something specific...especially if it is used with js, but I haven't figured out if there is a point to it just to say that it is a tag... (especially since the IDs need to be unique). eg. <table id="table">

...same concept as people using classes (<p class="para">, <blockquote class="block">, etc.). Just define the base tag, then use a class or ID for a specific deviation from the default.

If there IS a reason, I would be interested in knowing.
First off - ID's need to be unique - you can't define all your tables with the id="table". You would want to use a class.

Second - it's just silly to use a class to define an element as that element. Why would you use <p class="para"> when the <p> means it is a paragraph in the first place?? You would simply define your standard/normal/default paragraph styling in your CSS, then use a class for any paragraph that is NOT standard.

Code:
p {margin:0; text-indent:1.2em} //* or whatever you want *//
p.red {font-weight:bold; color:red}

<p>This is a normal paragraph.</p>
<p>This is a normal paragraph.</p>
<p>This is a normal paragraph.</p>
<p class="red">This is a red, bold, paragraph.</p>
<p>This is a normal paragraph.</p>
<p>This is a normal paragraph.</p>
<p>This is a normal paragraph.</p>
The same concept applies to <blockquote class="block">, and <div class="division"> - or even worse - <div class="para">, <div class="block">.
Turtle91 is offline   Reply With Quote