HTML Learning Basics

Source: Internet
Author: User

About the various details of learning HTML

1.<a> is a link label, similar to the linked address is filled in <base>. <base href= "http://..."/>

2.<base> tags can only be defined in the header, and only one can appear.

3.<link> can only be defined in the head, but may occur more than once. The href attribute to point to the URL of the attached document. His value can make the URL of any valid document.

4. Forward link and reverse link rel/rev, both can be included in a link, you can also create multiple link tags at the same time.

5.link tags with external links (links to CSS files). The link's type attribute is used.

6.<p>p the label to mark the paragraph. <p class = Add a function in CSS style

<link href= "Main.css" rel= "stylesheet" type= "Text/css"/> CSS styles:

. p1{
font-size:10px;

7. Create an internal style sheet for the document with the <style> tag

<style> can only appear in the head, but may appear multiple times in the head. Is the only way to create an internal style sheet for a document. The attribute type to use. The language, even CSS, is equivalent to the CSS lurking inside the HTML.

For example:

    <title>        style Label settings document type    </title>    <meta charset= "Utf-8"/>    <style type= "text/ CSS ">        . p1{font-size:10px;}        . p2{font-size:20px;}        . p3{font-size:30px;}    </style>

Run Result: omitted:

8. Set the style according to different media devices: like the media property of the style, point to a different device.

<! DOCTYPE html>

9.1<script> tags. Add a script to the HTML, the script can be written in script, or you can use an external script file. Can make the page page become more vivid, and can be in the client corresponding certain events, so that the page has good interactivity.

The Type property of the script tag sets the kind of scripting language. Usually there are text/javascript and Text/jsscript. The former is usually used.

Example, a dialog box pops up when the page load is complete.

<!DOCTYPE HTML><HTML><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"/>    <title>set the type of script</title>    <Scripttype= "Text/javascript" >window.onload= function() {alert ("Hello World"); }    </Script>    <MetaCharSet= "Utf-8" /></Head><Body></Body></HTML>

9.2 External scripts, usually separated by JavaScript from HTML, are generally stored in the. js file. The file is then referenced through the SRC attribute of the script.

Core code: <script type= "Text/javascript" src= "Mian.js" >.

JS file:

Window.onload = function () {
Alert ("I Like You");
}

10<meta> tags, define metadata, and specify a keyword by name or Http-equiv property. Each keyword represents a metadata segment that describes the metadata segment by setting the value corresponding to the keyword in the content property.

Meta is not displayed on the page, but it is important to display the page.

Meta tags define metadata, the most important of which are: keywords and description. Where keywords describes the keyword of the document, it is very useful to provide clues to search engines. Description is useful for providing search engines with a simple description of the document.

HTML Learning Basics

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.