http-equiv - what's equiv stand for? - html

Everyone knows what http stands for Hyper Text Transport Protocol for the HTML (Hyper Text Markup Language). What the heck does equiv stand for: equivalent? What does it mean. I know it can be used to specify refresh values and charset/encoding but that's no closer to understanding what it means.

equiv does stand for equivalent. It's equivalent to the HTTP response header. For example, these two are the same
<META http-equiv="content-type" content="text/html; charset=UTF-8">
Content-Type: text/html; charset=utf-8
The HTTP header should be used over the http-equiv meta tag though.
http://cyberprodigy.blogspot.com/2009/08/what-does-http-equiv-stands-for.html

Yes, equivalent. As in, it has an effect equivalent to specifying the given HTTP header.

Related

Why does Google use conflicting character encoding on it's homepage?

I've been doing some research on declaring character encodings, and thought I'd look at what google do on their homepage.
On the google homepage <head> tags they have:
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
But then in the http headers it's:
Content-Type: text/html; charset=ISO-8859-1
I'm interested in understanding they would do this.
Edit: It happens on https://google.com/ I'm certain I spotted this in the browser earlier, but now I get the expected content-type: text/html; charset=UTF-8. However, when I send a request from postman I get the same http header as before.
It appears that the response is based on the user-agent request header. If I send a request with a missing or unusual user-agent the response header is ISO-8859-1. Still not sure why this is done and would be interested in an explanation.

Where do I put an ETag, and what is the format?

I currently put this <meta cache-control: public ETag: "v019" />
in the <head> just under the <title>, but keep getting Errors in the W3 validator.
What is the format and where do I put this in my HTML5 file?
An ETag isn't useful unless it is in a real HTTP header. It shouldn't be in your HTML document at all.
That said, the syntax for an HTML meta tag with a simulation of an HTTP header is:
<meta http-equiv="cache-control" value="public">
<meta http-equiv="ETag" value=""v019"">
cache-control and ETag are not accepted values for it in HTML 5. You would need to be using HTML 4 or earlier (although it would still be pointless).

Setting two charsets? utf-8 and text/html

I'm new to learning HTML and learning about metadata in a webpage. It seems like people prefer you have to set the character set to support utf-8 and people are also saying have charset="text/html" so browsers know what kind of information they are receiving. How can I set both since it seems like both use the same attribute?
text/html is a media type, not a character set. The server can send a Content-Type: text/html; charset=utf-8 header to identify the content as HTML encoded as UTF-8. When you’re using a <meta> tag, though, the content is already known to be HTML and the only thing that matters is the charset, so HTML5 introduced the option to write <meta charset="utf-8"> as shorthand for <meta http-equiv="Content-Type" content="text/html; charset=utf-8">. (Older browsers also support this because people had a habit of forgetting quotes in the original.)
In short, if you’re using a <meta> tag, just write this:
<meta charset="utf-8">
and you’re done. The page is already HTML.

Meta tags and language

I have a website writteng in greek.
<meta name="keywords" content="" /> can I use greek language in content or just in english?
If I can write them using greek chars, do I have to add anything to meta tag?
Thank you
You can use any character you want from the character set you are using. Just make sure that your web server send the correct character set headers in the HTTP request. You may also add a <meta> element specifying the charset, but it's not strictly necessary.
I use UTF-8 in these examples as I think it's a code charset and prefer to use it myself. It's on its way to take over as the standard charset on the web.
HTTP header which should be sent by the web server:
Content-Type: text/html; charset=utf-8
Optional <meta> element for your document:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

How to set a charset header for a html page?

Even though i use the below meta tag to set the content-type and charset, i am not seeing the charset header in the firefox firebug debugger.
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
Any help is appericiated.
The meta tag does not affect the HTTP headers sent. (Long ago, it was kind-of meant to do such things, but apart some forgotten experiments, it never did.) It specifies the encoding to be implied if HTTP headers do not specify the encoding; so it’s really not equivalent to an HTTP header (as the name ´http-equiv` suggests) but a replacement, surrogate, Ersatz for an HTTP header.
The way to set the HTTP headers depends on the server software and its settings.
But if the headers do not specify the encoding, then the meta tag takes effect. You ca check via the View → Encoding menu in Firefox which encoding is being applied.
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
It is how you set charset header for HTML files,there is nothing wrong.
Why would you use firebug to check the Charset? Just right click your mouse key and from the context menu select view page info and it will give you the page charset.