PDA

View Full Version : Simple Question- META ID or NAME



adamorjames
Nov 19th, 2006, 05:03 PM
I'm thinking I know the answer but I would like to know for sure. I've read that the "name" for some specific things has been changed to "id" but I didn't find anything about the "name" for "meta" changing to "id". So, basically, can I use "id" for "meta"? Another question is do I have to use quotes when I'm talking about "meta" and other stuff, could I say meta tag? I'm new to web coding? so I'm not too sure how I should describe all of this stuff like attributes and such, thanks.

VIPStephan
Nov 19th, 2006, 08:49 PM
For meta tags (yes, you can call it like that) there is no id attribute. That name - id replacement is only for elements in the visible part of the document (the stuff in the <body> area).
The only valid attributes for meta tags are http-equiv, name, and content whereas http-equiv does the same as name (I think I've read somewhere), so if you really don't wanna use name, use http-equiv.

And yes, always use (double) quotes for values of attributes (required in XHTML anyway).

adamorjames
Nov 20th, 2006, 12:15 AM
Sorry let me rephrase my 2nd question. I'm not sure what I should call stuff when I'm having a conversation. I don't know which are tags and which are attributes and what all the rest is. Can anyone list a few examples of tags and attributes, it would be greatly appreciated so I can know the difference. I'm thinking tags are --> meta, title, body, head, h3, etc and attributes are http-equiv, name, id, etc. Once I know the difference for sure then I can start saying stuff like "This meta tag has an attribute of blah blah" instead of " "Meta has an "id" of blah blah ".

Arbitrator
Nov 20th, 2006, 12:56 AM
The only valid attributes for meta tags are http-equiv, name, and content whereas http-equiv does the same as name (I think I've read somewhere), so if you really don't wanna use name, use http-equiv.Which attribute, between name and http-equiv, should be used depends upon the meta element. I believe http-equiv is for those meta elements that are supposed to emulate an HTTP header. So it does matter which you use. Examples:


meta element: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
HTTP header: Content-Type: text/html; charset=UTF-8

In addressing your follow‐up:

<div>, </div>, <meta/>, <html>, <li>, </p>, <br/> are seven separate tags. To be more specific, some are closing, opening, and self‐terminating tags.
div, meta, html, li, p, br are six different elements. In normal English, you might reference them by their full names; thus the a element becomes the anchor element.
<div></div> collectively refers to a div element. <meta/> refers to a meta element.
Elements without content or that are self‐terminating are called empty elements.
Elements that are replaced by something such as iframe, img, and object are called replaced elements.
<div style="table-layout: fixed;"> has a style attribute with an attribute value of table-layout: fixed;.
In the above example, table-layout is a CSS property whereas fixed is a CSS value. Combined, table-layout: fixed; is a CSS declaration. table-layout: auto; would be a different declaration with the same property.
In address > span { background-color: yellow; text-decoration: overline; }, everything within curly brackets is called a declaration block. address and span are simple selectors and > is the descendant combinator. Taken as a whole, address > span is a selector. The entire thing I just call a CSS or style rule as Iím not sure what the correct term is.

I could go on about more terminology such as that for JavaScript, CSS specifics, namespaces, doctypes, and escapes, but Iíll leave it there.

adamorjames
Nov 20th, 2006, 01:08 AM
Thank you so much for explaining the terminology! Now I can hopefully make a better conversation when talking about HTML and CSS