When many students are learning the front-end, they may not know much about the difference between html and css. Today’s article PHP Chinese Network summarizes the information about html and css for those who need it. For comparison, let’s take a look at the specific content below.
The difference between css and html:
1. First let’s take a look at html:
html is HyperTextMark -The abbreviation of upLanguage, which is Hypertext Markup Language;
html is used to define the content structure of the document, including the content that users need to browse, including images, texts, and videos, which are the basic elements that constitute a web page;
html is the structure of the web page (Structure), which requires a variety of frames and layouts, such as frameset, iframe, div css layout, table layout, etc. It also supports form submission (HTML Form), including basic Forms, input boxes, input box types, text fields, lists, labels, etc.
The structure of html includes two parts: Head and Body. The header describes the information required by the browser, and the body contains the specific content to be explained.
Let’s take a look at a small example about html:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文网(php.cn)</title> </head> <body> <h1>我的第一个标题</h1> <p>我的第一个段落。</p> </body> </html>
The effect is as follows:
This example can be very clear Description about the structure of html. (Related recommendations: HTML Chinese Reference Manual and 2018 Front-end Introduction_HTML5)
After reading the basic content of html, let’s take a look at the basic content of css , after all, it is a comparison of the differences between css and html ^_^
2. Let’s take a look at css again:
css is the abbreviation of Cascading Style Sheets, that is Cascading style sheets, which is a web page layout standard developed and published by the W3C Association, is a supplement to the HTML language functions.
css is used to define the style of the html document, that is, the appearance. For example, dynamic text on the web page, text color, fonts, and animation effects can all be implemented by css.
The main purpose of css is to control fonts, colors, backgrounds, images and other various elements in web pages, so that the web pages can be displayed exactly according to the designer's requirements.
As shown in the following example:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文网(php.com)</title> <style> body { background-color:#d0e4fe; } h1 { color:orange; text-align:center; } p { font-family:"Times New Roman"; font-size:20px; } </style> </head> <body> <h1>CSS例子</h1> <p>这是一个段落。</p> </body> </html>
The effect is as follows:
CSS Video Tutorial-Jade Girl Heart Sutra Edition)
Through the above introduction to the basic contents of html and css, we can clearly see the difference between css and html What it is, CSS is mostly used for styles while HTML is used for text content. As long as you study it seriously, you can discover more things during the learning process. Related recommendations:The differences between XML, HTML, CSS and JS_javascript skills
[HTML/CSS]display: The difference between none and visibility:hidden_html/css_WEB-ITnose
The above is the detailed content of What is the difference between css and html? Comparison of the differences between css and html. For more information, please follow other related articles on the PHP Chinese website!