您的位置:首页 > Web前端 > HTML

html学习笔记

2016-09-02 13:47 197 查看
2016.9.2:

1. html不是一种编程语言,而是标记语言。html使用标记标签来描述网页。

     html文档包括标签和纯文本,Web浏览器的作用是读取html文档,并以网页的形式展示。

2. html标签:

     <h1>一号标题,有<h1>到<h6>6个级别的标题。

     <p>段落

     <q>引用,“”短句子加引号

     <hr/>创建水平分割线

     <br/>换行

     <a>链接,<a href="index.html">哈哈</a>

     <b>等文本格式化 http://www.w3school.com.cn/html/html_formatting.asp

     <img>图片,<img src="img.png" width="100" height="100">

     <!---->注释

3. html常见属性:

     属性值可以用双引号,也可以用单引号。

     name、id、class、align、style、bgcolor、

4. 尽量不要使用center、align、font等标签,使用style样式或css。

     <body style="background-color:yellow">

     <h1 style="font-family:verdana;color:red;font-size:20px;text-align:center;">A heading</h>

5. 条件注释:

<!--[if IE 8]>
.... some HTML here ....
<![endif]-->

只有IE会执行的html。

6. html使用样式css:

(1)外部样式表:

<head>
[code]<link rel="stylesheet" type="text/css" href="mystyle.css">

</head>[/code]

(2)内部样式表:

<head>
[code]<style type="text/css">
body {background-color: red}
p {margin-left: 20px}
</style>

</head>[/code]

(3)内联样式表:

<p [code]style="color: red; margin-left: 20px"
>
This is a paragraph
</p>[/code]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: