HTML5 alternative for rel="" [closed] - html

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
What is the HTML5 alternative for rel="" in the following code:
<span class="gte" rel="gte">
Without the rel="" attribute, the page is not functional, nor will it validate as HTML5 compliant.

The rel attribute is perfectly valid in HTML5, so it doesn't need an alternative, however it needs to be on a a, link or area element, because it defines the *rel*ationship between the current document and the linked document. Having it on an element which is not a type of link doesn't make any sense.
In order for your markup to validate you need to change the span to a or link and the value you use with the rel attribute needs to be allowed by the link types listed in the spec or have been approved by the microformats development process. I don't see gte listed in either place, maybe you could explain what you expect it to mean?
You say 'the page is not functional' but do not describe what functionality you're expecting? Normally a rel attribute does nothing, it's just semantic information. If you're just trying to add additional information to this element for use in by a script or other tool related to your own site then you should instead use data-* attributes.
If this information isn't helpful to you, perhaps you can explain more clearly what your problem is?

Related

Should we always specify an ID attribute in HTML? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
From https://www.w3schools.com/tags/att_global_id.asp:
In HTML5, the id attribute can be used on any HTML element (it will validate on any HTML element. However, it is not necessarily useful).
I'm making a browser-based application for internal use, which in one of the pages there is no CSS or JavaScript referring to any element of the page - just tables.
Should I still specify the id attribute for the elements though there is no (not yet) need to use it? Or it is just best practice to put id'entifiers for future use?
Only put required elements or attributes in HTML.
You do not need to put ID attribute if it is not required, and you can always add ID attribute whenever required.
Keeping only required elements in html will make it easy to read, clean, low on size and hence improves performance and speed.
IDs are useful if you want to perform end-to-end testing with a framework like Protractor since it is very easy to select the particular element you want. This is not necessary, however, because of CSS attribute selectors. You can select on parts of the CSS class in the DOM, even without an ID being present.
Does the ID make it easier? Sure, but is it required for displaying a page? No.
No need to add IDs if you're not going to use them. It will just add extra bytes to your website to load. I don't see why would you think you need them, the quoted text you added to your question doesn't say you should use them, it just says they CAN be used on any element.
No, it is not necessary. It is required only when you have to access any form control uniquely on a web page.

Why no data-* elements? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
This is a question to mostly satisfy my curiosity: with the growth and acceptance of larger javascript frameworks the last, say, 5 years, it has become increasingly common to have attributes on elements add custom behavior to known html elements. For this reason html5 introduces data-* attributes, which just about every tool, including the browser parsing the dom actively ignores while rendering but are key for Js framework to enrich html as full-fledged application platform.
With Angular directives (for example), app builders enrich html as a whole by adding the ability to even create custom elements. The thing is however, this is where editing tools, like Visual Studio, break, since they like to actively check if the html elements you add exist.
Now, my question is not about visual studio (I know how to disable html validation), but why did the creators of the html5 standard never considered to include data-* elements as well? Or maybe they did, and the idea was discarded somehow. Does anyone know?
The data- prefix is actually part of the HTML5 draft
these attributes are for semantic HTML; as an example, attaching a database ID to an HTML element so that HTML parsers can use this data. In the case of Angular, the custom attributes do not carry data; they extend HTML.
Mozilla has some guidelines on the topic of the data prefix: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_data_attributes
Edit The intent of HTML elements is to carry content to be displayed by the browser, attributes to attach meta-data to these elements and <head> to attach meta-data to the whole document. There are no data- elements in HTML so it's consistent with that design.

Css id used two times [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I heard that css id can be used for only one element in a page But this is true when we play with script but on presentation alone this is not affecting anything.
presentation Here there is no effect we are able to create things simply(created two div with same id->no effect).
presentation with script activity Here we cannot do anything this is what we know as it can be used only one time.
I know without script we are not going to do anything but i just want to share this things and get other web geeks opinion on this things.
I'm not sure what you're asking or telling us.
It's simply bad form and against spec to use an id twice in the same document, so don't do it.
If you think you want to use multiple ID's what you REALLY want to do is use a class instead.
From the CSS selectors spec:
What makes attributes of type ID special is that no two such attributes can have the same value in a conformant document, regardless of the type of the elements that carry them; whatever the document language, an ID typed attribute can be used to uniquely identify its element.
It does not specify what the UA must do when it encounters such a situation, and as most browsers are very lenient what you propose will most likely be styled correctly. But you will have an invalid document.

Are you familiar with <ins> tag in html? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I just found that google uses this tag for adsense,
but seems it also works without this tag,why they prefer to use it?
The <ins> tag is used to indicate content that is inserted into a page and indicates changes to a document. According to the HTML spec this was intended primarily for use in marking up versioning of a document.
Clients that aware of this tag may choose to display content inside this tag differently or not at all depending on what they are designed to do. This is very much semantic HTML
As for why Google decide to use it I couldn't say
INS is semantic tag describing something that is inserted to the text after the text was already published. It is not a big deal, it is I guess used by their robots to understand something they care about.
Adding semantics to markup allows tools to extract more meta data from them. Google is in the business of writing such tools, so has good reason to encourage the use of code that they can use.

Dynamic Way to Check for Broken Image ALT tags on Site? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Is there a website generator that can search for a given URL and output the urls where the images are missing their ALT tags?
Yes - use the w3c markup validator. It will output an error for <img> tags that do not have the required alt attribute.
Note that this will only happen for doctypes which require the alt attribute. I believe that, at minimum, all XHTML doctypes require it, so if your page does not already have that doctype, you might consider adding it temporarily to use the validator.
Why don't you use W3C Validator?
I found 2 sites
http://www.web-backlinks.com/webpageimgaltchecker.asp - seems to only do alt's
http://www.clarity-media.co.uk/alttagchecker.php - seems to only do alt tags.
As people mentioned you can use w3c validator but then you got to filter through all the other invalid ones and if your really only looking for imgs this might same you a bit of time.