HTML Meta
The HTML meta Element
Metadata is information about data.The tag provides metadata about the HTML document. Metadata will not be displayed on the page, but will be machine parsable.
Meta elements are typically used to specify page description, keywords, author of the document, last modified, and other metadata.
The tag always goes inside the head element.
The metadata can be used by browsers (how to display content or reload page), search engines (keywords), or other web services.
Keywords for Search Engines
Some search engines will use the name and content attributes of the meta element to index your pages.
<meta name="description" content="Free Web tutorials on HTML, CSS, XML" />
The following meta element defines keywords for a page:
<meta name="keywords" content="HTML, CSS, XML" />
The intention of the name and content attributes is to describe the content of a page.Note: A lot of webmasters have used <meta> tags for spamming, like repeating keywords (or using wrong keywords) for higher ranking. Therefore, most search engines have stopped using <meta> tags to index/rank pages.
HTML Scripts
The <script> tag is used to define a client-side script, such as a JavaScript.
The script element either contains scripting statements or it points to an external script file through the src attribute.
The required type attribute specifies the MIME type of the script.
Common uses for JavaScript are image manipulation, form validation, and dynamic changes of content.
The script below writes Hello World! to the HTML output:
<script type="text/javascript">
document.write("Hello World!")
</script>
document.write("Hello World!")
</script>
The HTML noscript Element
The <noscript> tag is used to provide an alternate content for users that have disabled scripts in their browser or have a browser that doesn’t support client-side scripting.The noscript element can contain all the elements that you can find inside the body element of a normal HTML page.
The content inside the noscript element will only be displayed if scripts are not supported, or are disabled in the user’s browser:
<script type="text/javascript">
document.write("Hello World!")
</script>
<noscript>Sorry, your browser does not support JavaScript!</noscript>
document.write("Hello World!")
</script>
<noscript>Sorry, your browser does not support JavaScript!</noscript>
HTML Entities
Some characters are reserved in HTML.
It is not possible to use the less than (<) or greater than (>) signs in your text, because the browser will mix them with tags.
To actually display reserved characters, we must use character entities in the HTML source code.
A character entity looks like this:
&entity_name;
OR
&#entity_number;
OR
&#entity_number;
To display a less than sign we must write: < or <
Tip: The advantage of using an entity name, instead of a number, is that the name is easier to remember. However, the disadvantage is that browsers may not support all entity names (the support for entity numbers is very good).
Non-breaking Space
A common character entity used in HTML is the non-breaking space ( ).
Browsers will always truncate spaces in HTML pages. If you write 10 spaces in your text, the browser will remove 9 of them, before displaying the page. To add spaces to your text, you can use the character entity.
HTML Uniform Resource Locators
A URL is another word for a web address.
A URL can be composed of words, such as "wirosableng.com", or an Internet Protocol (IP) address: 180.246.120.12. Most people enter the name of the website when surfing, because names are easier to remember than numbers.
0 comments:
Posting Komentar