You’re certainly already acquainted with document editors, like Microsoft Word, with which you can structure your document with titles, paragraph, lists, tables, images, bold and italic text.
HTML provides roughly the same elements of formatting. The key difference is that formatting text in Microsoft Word is visual, whereas HTML code is purely semantic: you provide meaning to your text.
The same way you use notes to write music, you use HTML to write webpages.
While HTML is about defining the content of a webpage, CSS is about styling a webpage. It means setting colors, fonts, dimensions, margins, positions, of a webpage’s elements.
CSS brings a webpage to life, by applying a coat of paint on its static content, and elevates its purpose through color, space, emphasis and motion.
您当然已经熟悉了Microsoft Word等文档编辑器,您可以使用它们来构建文档,包括标题,段落,列表,表格,图像,粗体和斜体文本。
HTML提供了大致相同的格式元素。关键的区别在于,Microsoft Word中的格式文本是可视的,而HTML代码纯粹是语义的:您为文本提供了意义。
与使用笔记编写音乐的方式相同,您使用HTML来编写网页。
虽然HTML是关于定义网页的内容,但CSS是关于网页的样式。这意味着设置网页元素的颜色,字体,尺寸,边距,位置。
CSS通过在静态内容上涂上一层油漆,将网页变为现实,并通过颜色,空间,重点和动作提升其目的。