-1

Привет

HTML5 depreciated ' <a name= ' in favor of CSS3 id. Do i have to define every 'anchor id' in a stylesheet?

example of how i'm interpreting what w3c is 'saying'.
<p id="SomeName">Some Text, blah, blah</p>
-or-
<p><span id="SomeName"></span>The <P>aragraph Text, blah, blah... </p>

So, do i have to define ' id="SomeName" ' in either head <style or a linked stylesheet?
#SomeName {
color:black;
font-family: Arial, Helvetica, ;
etc...
}

and repeat this for every 'internal link' , 'name' anchor i want to create? This, like most everything in CSS3 and HTML5 that is supposed to be 'better' seems to be a huge pain in the.... : )

Or,,, do i just 'lie' and label anything i want an 'id' ( <h1 id="MadeupID"> ) without having to describe the ID in style?

Sorry, but i'm not very good with words, so i hope this is enough to go on.
Thanks in advance, Спасибо,
Landis.

ps, i've found many articles, both here and on the interweb, but none are clear as to whether or not the id needs to be defined in stylesheet or styled in anyway.

Community
  • 1
  • 1
Landis Reed
  • 39
  • 1
  • 9

1 Answers1

1

HTML5 depreciated 'name'

The name attribute for anchor targets was deprecated in XHTML.

in favor of CSS3 id.

No, in favour of HTML's id attribute.

So, do i have to define id="SomeName in either head style or a linked stylesheet?

No, you don't have to style anything you don't want to style.

Or,,, do i just 'lie' and label anything i want an 'id' ( <h1 id="MadeupID"> ) without having to describe the ID in style?

Not styling something isn't a lie.

The id attribute provides a way to identify an element. That identification can be used by CSS selectors, by JavaScript, by URL fragment identifiers, and a few other things. It doesn't have to be used at all.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • Thank You, Questin.
    so, the id belongs to the element and 'describing' it or styling it, is just that, styling an ID or element that already exists. It's Not 'created' in the stylesheet, then used somewhere. Got IT!
    Спасибо, Landis.
    – Landis Reed Apr 23 '13 at 06:39