📜  HTML 和 CSS 的区别

📅  最后修改于: 2021-09-01 02:46:13             🧑  作者: Mango

  • HTML
    HTML 代表超文本标记语言,它是用于定义网页结构的语言。 HTML 与 CSS 和Java脚本一起用于设计网页。 HTML 是网站的基本构建块。它具有不同的属性和具有不同特性的元素。每个元素都有一个开始和一个结束标记。我们还可以借助 HTML 来添加图像。例子:
    
    
        

    Welcome to GeeksForGeeks

    输出:

  • CSS:
    CSS 代表级联样式表,它用于设置 Web 文档的样式。它用于提供背景颜色,也用于样式。它还可用于设置字体样式并更改其大小。我们还可以借助 CSS 来设计具有相同规格的许多不同网页。万维网联盟 (W3C) 也推荐 CSS。它还可以与 HTML 和Java脚本一起使用来设计网页。
    例子:
    
    
    
    
    
      
    

    Welcome to GeeksForGeeks!

      

    This page has red background color

      

    输出:

HTML 和 CSS 的区别:

S.NO. HTML CSS
1. HTML is used to define a structure of a web page. CSS is used to style the web pages by using different styling features.
2. It consists of tags inside which text is enclosed. It consists of selectors and declaration blocks.
3. HTML doesn’t have further types. CSS can be internal or external depending upon the requirement.
4. We cannot use HTML inside a CSS sheet. We can use CSS inside a HTML document.
5. HTML is not used for presentation and visualization. CSS is used for presentation and visualization.
6. HTML has comparatively less backup and support. CSS has comparatively higher backup and support.