Learn to write a webpage #04 # W3school

Source: Internet
Author: User
Tags html form html header naming convention

Index:

    • HTML input type
    • Xhtml
    • HTML5
    • HTML5 Style guidelines and code conventions

The WHO was established in 1948.

Marking abbreviations can provide useful information for browsers, translation systems, and search engines.

The code element does not retain extra spaces and wrapping:

To resolve this problem, you must surround the code in the pre element:

var person = {    FirstName: "Bill",    lastName: "Gates",    age:50,    eyecolor: "Blue"}

Einstein's formula:

E= m c 2

By using HTML4.0, all the formatting code can be moved out of the HTML document and then moved into a separate style sheet.

Style sheet is divided into three kinds, one is to put the CSS in a separate file, called "External style sheet", the other is to put CSS in

<style= "color:red; margin-left:20px">This isa paragraph </ P >

Hypertext Links
Note: Always add a forward slash to a subfolder. If you write this link: href= "http://www.w3school.com.cn/html", it will generate two HTTP requests to the server. This is because the server adds a forward slash to this address, and then creates a new request, like this: href= "http://www.w3school.com.cn/html/".

HTML Images

What's less used is to create an image map

HTML <div> and <span>

Block-level elements usually start (and end) with a new line when the browser is displayed.

Example:

Inline elements typically do not start with new lines when they are displayed.

Example: <b>, <td>, <a>,

Another common use of the <div> element is the document layout. It replaces the old-fashioned way of using tables to define layouts. Using the <table> element for document layout is not the correct use of the table. The function of the <table> element is to display tabular data.

HTML <div> elements are block-level elements. It can be used as a container for other HTML elements.

HTML <span> elements are inline elements that can be used as a container for text.

Sets the class of the <span> element to be able to set the same style for the same <span> elements.

HTML-Responsive Web design

One way is to write it yourself, for example, say:

{float: left; margin: 5px; padding: 15px; width: 300px; height: 300px; border: 1px solid black

Another method is to use Bootstrap, as if it were essentially similar. (referencing an external style sheet, following the naming convention)

HTML Framework

The navigation frame jumps to a specified section within the frame

By using the framework, you can display more than one page in the same browser window. Each HTML document is called a frame, and each frame is independent of the other.

<Framesetcols= "25%,50%,25%">  <Framesrc= "/example/html/frame_a.html">  <Framesrc= "/example/html/frame_b.html">  <Framesrc= "/example/html/frame_c.html"><noframes><Body>Your browser cannot handle the frame!</Body></noframes></Frameset>

-IFRAME is used to display Web pages within a Web page.

HTML ScriptElements

-<noscript> Labels

<script type= "Text/javascript" >document.write ("Hello world!" )</script><noscript>your Browser does not support javascript!</noscript>

-How to deal with old-fashioned browsers

<script type= "Text/javascript" ><!--document.write ("Hello world!" )//-</script>

HTML Header Element

Meta data (metadata) is information about the data.

The <meta> tag provides metadata about the HTML document. The metadata is not displayed on the page, but is readable for the machine.

Typically, the meta element is used to specify the description of the page, the keywords, the author of the document, the last modification time, and other metadata.

The <meta> tag is always in the head element.

Meta data can be used in browsers (how to display content or reload pages), search engines (keywords), or other Web services.

Some search engines use the name and content properties of the META element to index your page.

<name= "description"  content= "Free Web tutorials on HTML, CSS, XML"  /><name= "keywords"  content= "HTML, CSS, XML "/>

URL encoding converts characters into a format that can be transmitted over the Internet.

HTML Color Name

The color selection can be referred to the W3school table.

HTML Form

<input type= "Submit" > defines the button used to submit a form to the form handler (Form-handler).

A form handler is typically a server page that contains a script to process the input data.

The form handler is specified in the form's Action property, and if the Action property is omitted, the action is set to the current page.

The method property specifies the HTTP methods (GET or POST) that are used when the form is submitted

When you use GET, the form data is visible in the page's address bar -if it is a get, you can edit the address directly and enter it instead of submitting it on the page.

HTML input type

<input type= "button> definition button.

<type= "button"   onclick= "alert (' Hello world! ')"  value = "click me!" >

<input type= "Number" > is used for input fields that should contain numeric values.

You can limit the number.

Restrictions can be applied to input fields, depending on browser support.

XHTML-Properties

XHTML is a stricter and purer HTML version

For example, it disables attribute shorthand, which is wrong:

<checked><readonly><  disabled > < selected > 

That's right:

<checked= "checked"/><readonly  = "ReadOnly"/><disabled= "disabled"/>  <selected= "selected"/>

HTML5

HTML5 is the latest HTML standard.

HTML5 is designed for hosting rich Web content without the need for additional plugins.

HTML5 has new semantics, graphics, and multimedia elements .

HTML5 provides new elements and new APIs that simplify the building of Web applications.

HTML5 is cross-platform and is designed to run on different types of hardware (PC, tablet, phone, TV, etc.).

Canvas and SVG are HTML5, as are vidio and audio.

new semantic/structural elements

Footer headers and other block-level elements are also.

Semantic elements clearly describe their meaning to browsers and developers.

Examples of non-semantic elements:<div> and <span>-cannot provide information about their content.

Examples of semantic elements:<form>, <table>, and -clearly define their content.

HTML5 Style guidelines and code conventions

! Start reading in detail from the middle of the W3school page.

Learn to write a webpage #04 # W3school

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.