• css和html的三种结合方式 页内和页外


    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    </head>
    <body>
    <!--
    结合方式01:
    在标签上加入style属性.
    属性的值就是css代码.
    -->
    <p style="color:red;" >itcast传智播客</p>
    </body>
    </html>

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <style type="text/css">
    p {
    color:blue;
    }
    </style>
    </head>
    <body>
    <!--
    结合方式02:
    在页面的head标签中, 书写一个style标签.
    在style标签中书写css代码.

    -->
    <p>itcast传智播客</p>
    <p>itcast传智播客</p>
    </body>
    </html>

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <link type="text/css" rel="stylesheet" href="p.css" />

    rel:relationship的英文缩写·REL属性用于定义连接的文件和HTML文档之间的关系。StyleSheet,的意思就是样式调用,

    type: 告诉浏览器 连接的文件类型 text/css
    </head>
    <body>
    <!--
    结合方式03:
    在页面head标签中填写link标签
    <link type="text/css" rel="stylesheet" href="p.css" />
    type mime类型
    rel 类型
    href css文件路径
    -->
    <p>itcast传智播客</p>
    <p>itcast传智播客</p>
    </body>
    </html>

  • 相关阅读:
    c++:函数模板
    1084 外观数列
    1083 是否存在相等的差
    1082 射击比赛
    1081 检查密码
    1080 MOOC期终成绩
    1079 延迟的回文数
    1078 字符串压缩与解压
    1077 互评成绩计算
    1076 Wifi密码
  • 原文地址:https://www.cnblogs.com/nextgg/p/7646137.html
Copyright © 2020-2023  润新知