3

Is id only used for documentary purposes? I searched all code for the id's, could not find any reference to the id's.

<link rel='stylesheet' id='layerslider-css'  href='css/.....
<link rel='stylesheet' id='cookie-consent-style-css'  href='css/.....
<link rel='stylesheet' id='wpcloudy-css'  href='css/wpcloudy.min.css?'   />
<link rel='stylesheet' id='mkd_burst_default_style-css'  href='.....
  • The ID attribute is not valid in base, head, html, meta, param, script, style, and title tags: w3schools.com/tags/att_standard_id.asp Though w3schools isnt a good source but w3 documentation doesnt say you can use id in these tags: https://www.w3.org/TR/html401/struct/global.html#h-7.4 – Pratik Soni Oct 06 '17 at 11:14
  • It could potentially be used to identify it on the server end of things during view rendering (If the dom document is loaded from a templates folder or something, I don't know a thing about wordpress, however). – ZombieTfk Oct 06 '17 at 11:16
  • 1
    @PratikSoni — Why are you looking at the HTML 4.01 specifcation? HTML 5 has been stable for years. – Quentin Oct 06 '17 at 11:20
  • You can use an id on a link element for pretty much anything that you can use an id for on any other element. You seem to be asking what the author of the document you are looking at is using it for. We have no way of knowing that and could only guess and give opinions. (Voting to close as off-topic because it is opinion based). – Quentin Oct 06 '17 at 11:21
  • 2
    IDs can be used by JS to selectively enable/disable stylesheets, by setting the `disabled` attribute on the `` element: https://stackoverflow.com/questions/3182840/removing-or-replacing-a-stylesheet-a-link-with-javascript-jquery – Terry Oct 06 '17 at 12:09
  • Sorry, maybe I was not clear enough. These are links to external css-files and I was wondering why they have an id. would you reference to a particular css-file by an id? – Peter Juselius Oct 06 '17 at 13:38

0 Answers0