• XHTML十步进行曲


    < DOCTYPE html PUBLIC -WCDTD XHTML StrictEN httpwwwworgTRxhtmlDTDxhtml-strictdtd>
    1.要进行声明,放在最顶部。
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    2.要进行名字空间
    <html xmlns="http://www.w3.org/1999/xhtml" lang="gb2312">

    3.定义语言编码
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <?XML version="1.0" encoding="gb2312"?>

    4.调用样式表
       内嵌式:
    <style type="text/css"><!-- body {background:#fff;color:#000;} --></style>
       外部式:
    <link rel="stylesheet" rev="stylesheet" href="css/style.css" type="text/css" media="all" />
       双表法:
    <link rel="stylesheet" rev="stylesheet" href="css/style.css" type="text/css" media="all" />
    <style type="text/css" media="all">@import url(css/style01.css );</style>

    5.收藏夹小图标(注意图标要放在跟目录哦!)
    <link rel="icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />

    6.为搜索引擎准备的内容
    允许搜索机器人搜索站内所有链接。如果你想某些页面不被搜索,推荐采用robots.txt方法
    <meta content="all" name="robots" />
    设置站点作者信息
    <meta name="author" content="[email]yecaomail@163.com[/email],野草" />
    设置站点版权信息
    <meta name="Copyright" content="www.yecaoweb.com,XHTML,ASP" />
    站点的简要介绍(推荐)
    <meta name="description" content="设计网站" />
    站点的关键词(推荐)
    <meta content="Web,standards,xhtml,css,Design" name="keywords" />

    7.XHTML代码规范
    *一层一层的嵌套必须是严格对称
    *必须都是小写
    *属性值必须要有引号
    *必须严格关闭标签

    8.CSS入门
    *群选择器,如:p,td,li{font-size:12px;}
    *派生选择器,如:li a{color:#000;}
    *id选择器,如:#pic{color:#000}   //调用时用,如<p id="pic"></p>
    *类别选择器,如:.pic{color:#000}   //调用时用,如<p class="pic"></p>
    *超连接设置,CSS中用四个伪类来定义链接的样式,分别是:a:link、a:visited、a:hover和a : active,例如:

       a:link{font-weight:bold;text-decoration:none;color:#c00;}
       a:visited {font-weight:bold ;text-decoration:none;color:#c30 ;}
       a:hover {font-weight:bold;text-decoration:underline ;color:#f60 ;}
       a:active {font-weight:bold;text-decoration:none;color:#F90;}

    9.CSS布局入门,常用CSS属性,如下:
       position:absolute;    //绝对定位
       float:left或right;    //浮动
       clear:both或left或right   //取消浮动(就像吃玩饭后要洗碗一样!)
       padding:0px;          //内补丁
       margin:0px;           //外补丁
       display:block或inline; //外联或内联
       background:url(img.gif) #000 repeat-x left; //url(图象) 颜色值 重复 对齐方向
       border:#000 2px solid;    //边框颜色 边框宽度 边框样式

    10.校验及常见错误
       到老外的网站去验证,[url]http://validator.w3.org/[/url] (为什么不是中文网站!-_-$)
  • 相关阅读:
    分享点干货(此this非彼this)this的详细解读
    程序员需要掌握的排序算法之希尔排序(最小增量排序)
    JAVA基础学习笔记
    简单的时间日期格式化(未封装成控件)
    面试造航母,工作拧螺丝
    浅谈jquery插件开发模式
    Relative与Absolute组合使用
    表单
    个人介绍
    用计数法解决数组排序问题
  • 原文地址:https://www.cnblogs.com/netcorner/p/2912396.html
Copyright © 2020-2023  润新知