HTML 和 CSS 基础

<!DOCTYPE html>
<html lang="en">
<!--here is comment for the coding-->

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS selector</title>
    <style>
        * {
            font-size: 18px;
            font-weight: bold;
        }

        p {
            color: red;
        }

        .p2 {
            color: green;
        }

        #p3 {
            color: blue;
        }

        div p {
            color: cyan;
        }

        .p2,
        #p3 {
            font-style: italic;
        }
    </style>
</head>

<body>
    <h1 align="center">Hello World</h1>
    <h2>2 header</h2>
    <h3>3级标题</h3>
    <h4>4jibiaoqian </h4>
    <h5>5jibiaoqian </h5>
    <h6>6jibiaoqian </h6>
    <p>this is a paragraph</p>
    <p class="p2">here you are with class name p2 using ".p2"</p>
    <p id="p3">here is related id number p3 using "#p3"</p>
    <div>
        <p>div中嵌套的p</p>
    </div>
    <a href="https://www.baidu.com">change to baidu</a>
    <div><img src="demo.png" alt="图片" width="400px"></div>

</body>

</html>

结果:

HTML的DOM和CSS渲染的基础。

相关推荐

  1. HTMLCSS基础(二)

    2024-02-03 10:46:02       9 阅读
  2. 基础八股文】html css js

    2024-02-03 10:46:02       35 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-02-03 10:46:02       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-02-03 10:46:02       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-02-03 10:46:02       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-02-03 10:46:02       20 阅读

热门阅读

  1. 【CS3CA】Computer Animation

    2024-02-03 10:46:02       29 阅读
  2. 《每天一分钟学习C语言·十三》

    2024-02-03 10:46:02       37 阅读
  3. linux 内核升级

    2024-02-03 10:46:02       28 阅读
  4. 基于机器学习的无损缺陷检测技术研究进展

    2024-02-03 10:46:02       35 阅读
  5. 2.2作业

    2.2作业

    2024-02-03 10:46:02      33 阅读
  6. Vue 图片加载失败处理

    2024-02-03 10:46:02       23 阅读
  7. Vue3快速上手

    2024-02-03 10:46:02       28 阅读
  8. react+ts

    react+ts

    2024-02-03 10:46:02      29 阅读