zoukankan      html  css  js  c++  java
  • 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>

  • 相关阅读:
    [BZOJ1303][CQOI2009]中位数图
    [BZOJ1192][HNOI2006]鬼谷子的钱袋
    9.5题解
    9.3题解
    9.2题解
    9.1题解
    8.29题解
    8.28题解
    8.23<2>题解
    8.23<1>题解
  • 原文地址:https://www.cnblogs.com/nextgg/p/7646137.html
Copyright © 2011-2022 走看看