Home Web Front-end HTML Tutorial HTML basic notes

HTML basic notes

Jan 22, 2018 am 10:45 AM
html Base notes

这次给大家带来HTML的基础笔记,下面就是实战案例,一起来看一下。

一,网页基础结构:

<html>  
    <head>  
                <title>我的第一个网页</title>  
    </head>  
    <body>  
                这是我的第一个网页   
    </body>  
</html>
Copy after login

注意:在HTML中,标签大部分都是成对出现的。有开始就有结束

如果不是成对出现的标签,在标签的后面加上/表示结束。

二、基本标签

1、h1-h6 标题标签
2、em 斜体
3、strong 粗体
4、hr 切割线
5、br 换行
6、p 段落标签
7、 特殊符号,空格
8、> 特殊符号,>
9、< 特殊符号,<
10、" 特殊符号,"
11、© 特殊符号,版权符号
12、注释
13、img 图片标签

属性:src:图片的路径,alt:当图片找不到时,显示的文字
title:鼠标悬浮显示的文字
用法:

<img src="..." alt="..." title="..."/>
Copy after login

14、a 超链接标签
属性:href:链接到哪里去
用法:
链接
锚链接
先在一个位置写上
然后另一个位置写上
点击这个链接,会找到这个?所在的位置

用法:
链接到这了来
从这了链接

15、ul-li 无序列表
用法:

<ul>
<li>列表项1</li>
.......
<li>列表项n</li>
</ul>
Copy after login

注意:没有顺序,每一个li就是一行
默认情况下,每一个li前面都有一个实心小点

16、ol-li 有序列表
用法:

<ol>
<li>列表项1</li>
.......
<li>列表项n</li>
</ol>
Copy after login

就是将无序列表的实心小点换成了序号

17、dl-dt-dd定义列表
用法:

<dl>
<dt>标题1</dt>
<dd>内容1</dd>
<dt>标题2</dt>
<dd>内容2</dd>
</dl>
Copy after login

实现效果:
标题1
内容1
标题2
内容2

18、表单元素
a、text 单行文本框
b、password 密码框
c、radio 单选按钮
d、file 文件选择器
e、checkbox 复选框
f、select 下拉列表
g、submit 提交按钮
h、reset 重置按钮
i、textarea 文本域

用法:

j、form标签 提交标签
语法:


如果action为空,则表示提交到当前页面
method可选属性:post、get
post安全性高,提交的信息不会显示在地址栏
get安全性较低,提交的信息显示在地址栏
如果不写method属性,默认是get

k、input标签 可选值:就是表单元素a-i

l、select 下拉列表

用法:

<select>
<option>2016</option>
<option>2015</option>
<option>2014</option>
</select>
Copy after login

m、 关联表单

作用:点击名字这两个字,鼠标会聚焦在名字后面的文本框中

三、注意:
1、标签名应该小写
2、HTML标签应闭合(结束)
3、标签应正确嵌套

四、表单属性
1、readonly="readonly" 只读
2、disabled="disabled" 禁用

五、表格
1、什么是表格?
最简单的就是队列,表格之间,可以写东西

2、表格怎么使用?
先画一个大框,再画每一行,再画每一列

<table>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
Copy after login

3、数据或者说是元素都可以放在td里面

4、table的一些属性:
width:设置宽度
border:边框的粗细
align:对齐方式,最常见的,center,水平对齐
valign:对齐方式,最常见的,center,上下对齐
cellspacing="20" :格子与格子之间的距离,默认值是0
cellpadding="20":内容与格子之间的距离,默认值也是0
bgcolor:更改背景颜色

5、合并:
colspan="2":合并单元格,横着合并
rowspan="2":合并单元格,竖着合并

相信看了这些案例你已经掌握了方法,更多精彩请关注php中文网其它相关文章!

相关阅读:

HTML文本格式化的实例详解

html里的列表标签有哪些?

html标题,段落,换行,水平线,特殊字符应该如何使用

The above is the detailed content of HTML basic notes. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

HTML Input Placeholder HTML Input Placeholder Sep 04, 2024 pm 04:54 PM

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.

See all articles