XHTML到HTML5工作流程

A great deal of money will be spent over the next several years to rewrite and update existing websites to HTML5. Essentially this is a pre-Y2K period for web developers: a lucrative, once-in-a-generation opportunity to be part of an epochal change.

在接下来的几年中,将花费大量资金来重写现有网站并将其更新为HTML5。 从本质上讲,这是Web开发人员进入Y2K之前的时期:一个有利可图的,千载难逢的机会,成为时代变革的一部分。

Technically, merely changing the first line of the HTML code on a page to <!DOCTYPE html> is enough to make it HTML5; even loosely coded pages should validate, given HTML5's lowering of standards.

从技术上讲,仅将页面上HTML代码的第一行更改为<!DOCTYPE html>就足以使其成为HTML5。 鉴于HTML5降低了标准 ,即使是松散编码的页面也应进行验证。

Doing so, however, is a merely superficial nod to HTML5. Taking complete advantage of the spec – making a true HTML5 page – means rewriting and re-contextualizing code everywhere in the page.

但是,这样做只是对HTML5的肤浅表述。 充分利用规范–制作一个真正HTML5页面–意味着重写页面中的代码并使代码重新上下文化。

This article will outline the workflow process for converting a complete, valid, XHTML 1.0 Strict document to HTML5. It consists of several steps:

本文将概述将完整,有效的XHTML 1.0 Strict文档转换为HTML5的工作流程。 它包括几个步骤:

  1. Make a copy of your entire website, and work your changes on the copy

    制作整个网站的副本 ,然后在副本上进行更改

    You do not want to be caught halfway through the process and forget what you have changed, or lose your references before rewriting your CSS.

    您不想在过程中途陷入困境,而忘记了所做的更改,或者在重写CSS之前丢失了引用。

  2. Change the DOCTYPE and <head> section to HTML5 markup

    DOCTYPE<head>部分更改为HTML5标记

  3. Remove Dublin Core metadata

    删除都柏林核心元数据

  4. Add microformats and microdata as appropriate.

    适当添加微格式和微数据。

    Traditional metadata is supplemented (and, to a degree, supplanted) by microformats and microdata in HTML5. The appropriate markup to add, and its associated data, will depend on the content of your page and how it is used.

    HTML5中的微格式微数据对传统的元数据进行了补充(并在一定程度上替代了)。 要添加的适当标记及其相关数据,将取决于页面的内容及其使用方式。

  5. Update tags for external stylesheets and JavaScript files

    更新外部样式表和JavaScript文件的标签

    The links themselves will not change, but you should remove unneeded attributes such as type.

    链接本身不会改变,但是您应该删除不需要的属性,例如type

  6. Replace generic <div> containers with their appropriate HTML5 tags

    将普通的<div>容器替换为其相应HTML5标签

    <div id="header">, <div id="footer">, <div id=sidebar> and <ul id=nav> or their equivalents, should be replaced with <header>, <footer>, <aside> and <nav> respectively.

    <div id="header"><div id="footer"><div id=sidebar><ul id=nav>或其等效项应替换为<header>, <footer>, <aside> and <nav>分别。

  7. Divide remaining content, if self-explanatory, with <section> tags

    如果不言自明,请用<section>标签划分剩余内容

This is the minimum number of steps you should take to transform an existing web page into HTML5; I'd also suggest that the update process also allows the opportunity for a thorough review of a site's design and features.

这是将现有网页转换为HTML5所需的最少步骤; 我还建议,更新过程还应使您有机会全面审查网站的设计和功能。

翻译自: https://thenewcode.com/328/XHTML-to-HTML5-Workflow

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值