HTML是超文本标记语言(HyperText Markup Language)的缩写,是为“网页创建和其它可在网页浏览器中看到的信息”设计的一种标记语言,构成 Web 世界的一砖一瓦。它定义了网页内容的含义和结构。HTML 不是一门编程语言,而是一种用于定义内容结构的标记语言。
HTML 结构大概如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<title>页面标题</title>//标题
</head>
<body>
<h1>我的第一个Web页</h1>
<p>helloworld!</p>
</body>
</html>
HTML 的文本格式如下:
<p>You can use the mark tag to <mark>highlight</mark> text.</p>//强调
<p><del>This line of text is meant to be treated as deleted text.</del></p>//横线
<p><s>This line of text is meant to be treated as no longer accurate.</s></p>//横线
<p><ins>This line of text is meant to be treated as an addition to the document.</ins></p>//补充
<p><u>This line of text will render as underlined</u></p>//下划线
<p><small>This line of text is meant to be treated as fine print.</small></p>//精细打印
<p><strong>This line rendered as bold text.</strong></p>//粗体
<p><em>This line rendered as italicized text.</em></p>//斜体
HTML 的超链接格式如下:
<a href="你想加入的网站">网站名</a>
网页中的图片使用这种方法进行存储:
<img src="图片地址" alt="MDB Logo" width="宽度" height="高度">
而CSS 是级联样式表(Cascading Style Sheets)的缩写。HTML 用于撰写页面的内容,而 CSS 将决定这些内容该如何在屏幕上呈现。
CSS 语法:
选择器+{声明}
例如:
p{color:red;text-align:center;}//红色居中;
CSS可以控制文本的颜色、尺寸、整齐度、边框、定位、溢出、浮动、不透明度;