1

I am trying to say that what will happen if I put an ID between the CSS linking tag? Like the below:

<link rel='stylesheet' id='base.css-css'  href=''>

What does the ID actually there?

I didn't understand it actually and never saw it before anywhere. I saw one of Developer made a Template like this.

Please, help me anyone with this?

Sumon Khan
  • 143
  • 2
  • 10
  • This is not part of any standard or custom I'm aware of; it won't do anything specific. The `href=''` looks plain wrong though (as it points to the current URL). I'd ask the developer what this is about. Maybe they're doing some JavaScript shenanigans with it but I'd bet a beer what they're doing is bad practice then – Pekka Jun 19 '13 at 16:49
  • It doesn't *do* anything, but neither does an id in any other element do anything by itself. It's possible that the templating engine uses it to determine how to modify the tag before outputting the final HTML. – JJJ Jun 19 '13 at 16:50
  • "I am trying to say that what will happen..." Why don't you just try it then? `id` is a global attribute and can be applied to any tag. `` can still be accessed as a node in the DOM... referencing it by ID would make that easier. – skyline3000 Jun 19 '13 at 16:51
  • Hi, Thank you for your useful answer. Yes, the Developer added lot of Javascript file because the template included many transition and animation. Please, check this template source code and then reply me what you understand and what do you suggest me to using it? http://bookofpixels.com/iconik/ – Sumon Khan Jun 19 '13 at 16:52

2 Answers2

2

The element will have an id.

This will make it addressable by the id. e.g. from JavaScript/DOM document.getElementById.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • Hi, This is a nice answer to me. But, what will happen if I don't use the ID. Is this will affect anything? What's the benefit for make it addressable by the ID actually? – Sumon Khan Jun 19 '13 at 16:57
  • @SumonKhan If you're not even going to use the id, why do you care? Just install the theme as per the author's instructions and stop worrying. – JJJ Jun 19 '13 at 17:00
  • Dear @Juhana Thank you for your reply. I do care. I've to know this that why and how this works actually? Can you please tell me too If I don't use the ID then what will happen? Is this gonna affect something to the Theme? – Sumon Khan Jun 19 '13 at 17:03
  • Nothing is going to happen. – JJJ Jun 19 '13 at 17:04
  • @Juhana If nothing is going to happen then why he used it? I think, of-course there is something going to happen. But, don't know what it will be :O – Sumon Khan Jun 19 '13 at 17:09
  • *Then don't remove them.* – JJJ Jun 19 '13 at 17:13
  • @Juhana Then how I will understand why he put this and what's exactly work with this? – Sumon Khan Jun 19 '13 at 17:16
0

look i think this is not part of any standard but if think of it as puzzle you can understand it like this:

  1. href='' href is empty which may mean that the resource we are talking about is located under the root directly.(it's equivalent to '/').
  2. id='base.css-css' i think it's telling you which resource we are talking about. it's about css file called base.css-css
ebram khalil
  • 8,252
  • 7
  • 42
  • 60
  • Hi, Actually href='' isn't empty. I wrote it empty here. If this telling me that which resource it's talking about then I can easily understood it to see the href='' source. What does it actually? – Sumon Khan Jun 19 '13 at 16:56
  • from @Quentin answer i think you can use the id attribute to get the link as Dom-Element then when you have it you can get it's all attributes(and from it you can read href that may tell the resource file) – ebram khalil Jun 19 '13 at 17:03
  • It seems like a good answers to me! – Sumon Khan Jun 19 '13 at 17:06
  • if it helped you then i guess i deserve upvote at leaset – ebram khalil Jun 19 '13 at 17:09
  • Yeah, But I couldn't because my reputation is enough to do that :) – Sumon Khan Jun 19 '13 at 17:15
  • @SumonKhan upvote dose not take any points from you. read this http://meta.stackexchange.com/questions/7237/how-does-reputation-work – ebram khalil Jun 19 '13 at 17:20