HTML中base标签的使用

在公务员类网站中,考试大的SEO做得很出色。在考试大的首页源代码中发现了下面两行代码:
<base target=”_blank” />
<base href=”http://www.233.com/” />

通过Google“html base”,找到了下面两篇参考资料:

HTML base tag – W3Schools
http://www.w3schools.com/tags/tag_base.asp
HTML5 base Tag
http://www.w3schools.com/html5/tag_base.asp

在HTML4和HTML5中,base的用法是一样的。

用法举例:
<base href=”http://www.w3schools.com/images/” target=”_blank” />
href指定页面中所有相对链接的base URL。
target指定页面中所有超链接和表单默认的target,可选值包括_blank, _parent, _self, _top和framename。

也就是说,考试大的首页虽然保留了www.examda.com,但是页面中的所有相对链接都在www.233.com下打开。这样,虽然没有做全站的301跳转,但是流量同样可以从老域名逐步导向新域名。

最有价值的HTML5参考资料

Mozilla Firefox HTML5 开发者指南

网址: https://developer.mozilla.org/en/HTML/HTML5

Introduction to HTML5

文章网址: https://developer.mozilla.org/en/HTML/HTML5/Introduction_to_HTML5

内容简介: This article introduces how to use HTML5 in your web design or web application.

Forms in HTML5

文章网址: https://developer.mozilla.org/en/HTML/Forms_in_HTML

内容简介: A look at improvements to web forms in HTML5: the constraint validation API, several new attributes, new values for the <input> attribute type and the new <output> element.

Sections and outlines in HTML5

文章网址: https://developer.mozilla.org/en/Sections_and_Outlines_of_an_HTML5_document

内容简介: A look at the new outlining and sectioning element in HTML5: <section>, <article>, <nav>, <header>, <footer>, <aside> and <hgroup>.

Using audio and video

文章网址: https://developer.mozilla.org/en/Using_HTML5_audio_and_video

内容简介: HTML5 introduces built-in media support via the <audio> and <video> elements, offering the ability to easily embed media into HTML documents.

Apple Safari HTML5 开发者指南

网址: http://www.apple.com/html5/

简介: Every new Apple mobile device and every new Mac — along with the latest version of Apple’s Safari web browser — supports web standards including HTML5, CSS3, and JavaScript. These web standards are open, reliable, highly secure, and efficient. They allow web designers and developers to create advanced graphics, typography, animations, and transitions. Standards aren’t add-ons to the web. They are the web. And you can start using them today.

Safari Web Content Guide

文档网址:http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/Introduction/Introduction.html

内容简介: You should read this document if you want your web content to look good and perform well on either the desktop or iOS, plan to write iOS-specific web content, use iOS-specific style sheets, or use iOS native application links in your web content. Definitely read this document if you are creating a custom web application for either platform.

Preparing Your Web Content for iPad

文档网址: http://developer.apple.com/library/safari/#technotes/tn2010/tn2262/_index.html

内容简介: Platform-specific consideration for web content in Safari on iPhone OS devices, with specific information for iPad.

Safari HTML Reference

文档网址:http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariHTMLRef/Introduction.html

内容简介: This document details every HTML element and property supported by WebKit and Safari on all platforms, which include Mac OS X, iOS, and Windows. You should read this if you are developing web content that will be displayed in Safari or within a WebKit-based application.

Safari CSS Reference

文档网址:http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariCSSRef/Introduction.html

内容简介: You should read this document if you are creating web content for any version of Safari or any other WebKit-based application such as Dashboard.

Safari CSS Visual Effects Guide

文档网址:http://developer.apple.com/library/safari/#documentation/InternetWeb/Conceptual/SafariVisualEffectsProgGuide/Introduction/Introduction.html

内容简介: You should read this document if you want to use visual effects in your web content and web applications—if you are creating web applications for either Safari on the desktop or iOS. Definitely read this document if you are creating a custom web application for iOS.

Safari HTML5 Audio and Video Guide

文档网址:http://developer.apple.com/library/safari/#documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Introduction/Introduction.html

内容简介: If you embed audio or video in your website, you should use HTML5.

HTML5官方网站

网址: http://html5.org/

HTML5 differences from HTML4

文章网址: http://dev.w3.org/html5/html4-differences/

内容简介: The document describes the differences between HTML4 and HTML5 and provides some of the rationale for the changes.

The Web Platform

文章网址: http://platform.html5.org/

内容简介: Browser technologies

HTML5 validator

工具网址: http://html5.validator.nu/

功能简介: 检测给定网址的网页是否符合HTML5规范,在网页源代码中高亮出错位置。还提供了校对图片和替代文本的功能。

HTML 5 Demos and Examples

网址: http://html5demos.com/

简介: HTML 5 experimentation and demos the author has hacked together.

Simple class manipulation

网址: http://html5demos.com/classlist

Video

网址: http://html5demos.com/video

Content Editable

网址: http://html5demos.com/contenteditable

Geolocation

网址: http://html5demos.com/geo

HTML5 Rocks

网址: http://www.html5rocks.com/

简介: A resource for developers looking to put HTML5 to use today, including information on specific features and when to use them in your apps.

Interactive Presentation

网址: http://slides.html5rocks.com/

简介: Watch the slideshow that lets you play with HTML5 features.

Code Playground

网址: http://playground.html5rocks.com/

简介: Jump headfirst into HTML5 by experimenting with each API.

Samples Studio

网址: http://studio.html5rocks.com/

简介: A showroom of content that you can reuse in your own site.

Step by Step Tutorials

网址: http://www.html5rocks.com/en/tutorials/

简介: Take a guided tour through code that uses HTML5 features.

Presentation

文章网址: http://www.html5rocks.com/en/features/presentation

内容简介: With the introduction of CSS3 it has never been easier to create rich and beautiful sites and applications in HTML. There are many new technologies and extensions to CSS3 including: 2D Transformations, Transitions, 3D Transforms and WebFonts to name just a few. You can create rich user experiences with no coding effort required, just simply apply a little CSS to your existing applications.

Multimedia

文章网址: http://www.html5rocks.com/en/features/multimedia

内容简介: Audio and Video became first-class citizens on the Web with HTML5 the same way that other media types like images did in the past. Through their new APIs you can access, control and manipulate timeline data and network states of the files. With the coming additions to the APIs you will be able to read and write raw data to audio files (Audio Data API) or manipulate captions in videos (Timed Track API). But the real power of these new HTML elements stands out when they are combined with the other technologies of the web stack, be it Canvas, SVG, CSS or even WebGL.

Dive into HTML5

电子书网址: http://diveintohtml5.org/

内容简介: Dive Into HTML5 seeks to elaborate on a hand-picked Selection of features from the HTML5 specification and other fine Standards. The final manuscript has been published on paper by O’Reilly, under the Google Press imprint. Buy the printed Work — artfully titled “HTML5: Up & Running”.

w3schools HTML5 Tutorial

教程网址: http://www.w3schools.com/html5/

内容简介: HTML5 is the next generation of HTML. This tutorial teaches you about the new features in HTML5.

HTML5 doctor

网址: http://html5doctor.com/

简介: Helping you implement HTML5 today.

Article Archive

文档网址: http://html5doctor.com/article-archive/

内容简介: A complete list of all our posts grouped accordingly in order to get you started with HTML5 or to help you understand the specification and specific elements a little more.

HTML5 Element Index

文档网址: http://html5doctor.com/element-index/

内容简介: This is a quick reference of elements that are new or have been redefined in HTML5. For each element there is a short description, a link to the specification, and a code example. “Our prognosis” links to the HTML5 Doctor article on the element.