- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML Tag
The <meta> element in HTML is used to describe metadata i.e. the description, keywords, document’s author, etc. This metadata won’t be displayed on the page, but is used by the search engines, web browsers, etc.
Now, you can also set the viewport under <meta> to set the dimensions of the web page −
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Following are the attributes −
Sr.No | Type & Description |
---|---|
1 | Name Name for the property. Can be anything. Examples include, keywords, description, author, revised, generator etc. |
2 | content Specifies the property's value. |
3 | scheme (deprecated) Specifies a scheme to interpret the property's value (as declared in the content attribute). |
4 | http-equiv Used for http response message headers. For example, http-equiv can be used to refresh the page or to set a cookie. Values include content-type, expires, refresh and set-cookie. |
5 | charset The character encoding. |
Example
Let us now see an example to implement the <meta> tag −
<!DOCTYPE html> <html> <head> <meta name="description" content="Learn for free"> <meta name="keywords" content="Video tutorials, free tutorials, learn, web"> <meta http-equiv="refresh" content="20"> <meta name="author" content="Jack Sparrow"> </head> <body> <h2>Tutorials</h2> <p>Programming tutorials for free:</p> <ol> <li>Java</li> <li>C++</li> <li>C</li> <li>C#</li> </ol> </body> </html>
Output
This will produce the following output −
Advertisements