【HTML 笔记】(一)

Tool: Real-time HTML Editor

1. Element of HTML

<h1> Starbuzz Coffee Beverages </h1>

An element consists of the enclosing tags like <h1></h1> and the content in between. The tags <h1></h1>, <h2></h2>…present head titles.

2. HTML & CSS

The Browser uses its own built-in default style to display HTML.
HTML(Hyper Text Markup Language): structure the web page
CSS(Cascading Style Sheets): control the presentation of HTML

3. Import Image

<html>
	<body>
		<h1>Image</h1>
		<img src="image.gif">
		<p>description of the image</p>
	</body>
</html>

3. <style> Element CSS

<html>
	<head>
	
		<meta charset = "utf-8">
		<title> Starbuzz Coffee </title>
		<style type = "text/css">
			body {
					background-color: #d2b48c;
					margin-left: 20%;
					margin-right: 20%;
					border: 2px dotted black;
					padding: 10px 10px 10px 10px;
					<!-- padding between the content and the border (on all sides) -->
					font-family: sans-serif;
			}
		</style>
		
	</head>
	
	
	<body>
	
		<h1></h1>
		
		<h2></h2>
		<p></p>
		
		<h2></h2>
		<p></p>
		
	</body>
	
</html>

4. links to new pages

The element <a> is used to create a link to another page. The content of the <a> element is the link text.
点击text中的 “link” 字样,就会跳转到新的页面。

<body>
	<h1>Titel</h1>
	<p> This is a <a herf="new.html"> link </a> to another page.</p>
</body>
<link rel="stylesheet" type="text/css" href="theme.css" />
  • relative path
<p> locate in the root folder, but the <a herf="subfolder/new.html"> new html file  </a> is in a subfolder.
<p> locate in the sub folder, but the  <a herf="../../new.html"> new html file  </a> is in a root folder.

!! Don’t use spaces in the names for files and folders.

5. Text form

  • quote and block quote
<q>adding quote</q>

[output]: “adding quote”

<blockquote>
	Passing cars,
	When you can't see,
	May get you,
	A glimpse,
	of eternity.
</blockquote>

[output]:
Passing cars,
When you can’t see,
May get you,
A glimpse,
of eternity.

The <blockquote> element is a block element and the <q> element is an inline element.
Block element are always displayed as if they have a linebreak (break in the line / Return key) before and after them, while inline elements appear “in line” within the flow of the text in the page.
<blockquote>是独立的部分,<q>是一个内嵌元素,比如放在<p>元素的内部。

  • 斜体<em>text</em>
  • 换行<br>,不需要closing tag
  • 列表<li></li>,li = list item
    • <ol> ordered list
    • <ul> unordered list
    • <dl>definition list, 用来创建一个普通的列表
    • <dt>创建列表中的上层项目—>定义列表中的项目
    • <dd>创建列表中最下层项目—>描述列表中的项目
      —> <dt>和<dd>都必须放在<dl>标志对之间。
<ol>
	<li>Laptop</li>
	<li>Smart phone</li>
	<li>PC</li>
	<li>XBox</li>
	<li>Switch</li>
</ol>

[output]:

  1. Laptop
  2. Smart phone
  3. PC
  4. XBox
  5. Switch

6. Character entities

URL: HTML符号实体

<p>Kosten: &euro;1000</p>

URL:HTML ASCII
URL:HTML ISO-8859-1 参考手册

在这里插入图片描述

Quelle:
《深入浅出HTML和CSS》ISBN:978-7-5641-3894-3
W3school:HTML系列教程

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值