16-11-10
2016-11-10 20:24
204 查看
今天的内容有点意思,学习了如何在网页上添加图片,以及如何赋予图片或文字连接。
首先接触一下编辑命令:<img>图片标签、src标记图片位置,alt标记图片属性,这两个命令都是<img>的属性,<a></a>超链接,其属性href添加链接地址,这个命令有三个作用:1、作为本地文件的超链接 2、连接到网站网址 3、标记连接的锚点 target可以打开新的网页保留原来网页,在制作文字链接时,会出现下划线标识,可以用text-decoration编辑除去样式。
下以制作百度、宜搜、搜狐等链接为例:
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
h2{
width: 100%;
height: 50px;
background-color: pink;
}
ul{
width: 660px;
height: 50px;
background-color: yellow;
margin: 0px auto;
}
li{
color: white;
background-color: grey;
width: 100px;
height: 50px;
float: left;
/*列表样式*/
list-style: none;
/*文本水平居中*/
text-align: center;
/*行高*/
line-height: 50px;
/*右外边框*/
margin-right: 10px;
/*链接样式*/
text-decoration: none;
}
li:hover{
background-color: red;
}
</style>
</head>
<body>
<h2>
<ul>
<!-- target打开新网页保留原网页 -->
<a target="blank" href="http://www.baidu.com"><li>百度</li></a>
<!-- href超链接 -->
<a target="blank" href="http://www.easou.com"><li>宜搜</li></a>
<a target="blank" href="http://www.souhu.com"><li>搜狐</li></a>
<a target="blank" href="http://www.3g.qq.com"><li>QQ</li></a>
<a target="blank" href="http://www.taobao.com"><li>淘宝</li></a>
<a target="blank" href="http://www.jd.com"><li>京东</li></a>
</ul>
</h2>
<!-- src添加图片地址,.代表当前文件所在文件夹,..表示当前文件所在文件夹的 上层文件夹 -->
<img src="./a/1.jpg" alt="图片描述">
<!-- alt表示对图片的描述,这里有占位的作用,也利于SEO(搜索引擎) -->
<img src="./a/1.jpg" alt="图片描述">
</body>
</html>
这样便可编辑出网页标头,其实只要条理清晰便不会很繁琐,只需注意区分样式中要编辑的对象,以及<body>中命令父子关系的罗列表达即可。到今天的学习便可制作简单的网页了。
附件:http://down.51cto.com/data/2368367
首先接触一下编辑命令:<img>图片标签、src标记图片位置,alt标记图片属性,这两个命令都是<img>的属性,<a></a>超链接,其属性href添加链接地址,这个命令有三个作用:1、作为本地文件的超链接 2、连接到网站网址 3、标记连接的锚点 target可以打开新的网页保留原来网页,在制作文字链接时,会出现下划线标识,可以用text-decoration编辑除去样式。
下以制作百度、宜搜、搜狐等链接为例:
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
h2{
width: 100%;
height: 50px;
background-color: pink;
}
ul{
width: 660px;
height: 50px;
background-color: yellow;
margin: 0px auto;
}
li{
color: white;
background-color: grey;
width: 100px;
height: 50px;
float: left;
/*列表样式*/
list-style: none;
/*文本水平居中*/
text-align: center;
/*行高*/
line-height: 50px;
/*右外边框*/
margin-right: 10px;
/*链接样式*/
text-decoration: none;
}
li:hover{
background-color: red;
}
</style>
</head>
<body>
<h2>
<ul>
<!-- target打开新网页保留原网页 -->
<a target="blank" href="http://www.baidu.com"><li>百度</li></a>
<!-- href超链接 -->
<a target="blank" href="http://www.easou.com"><li>宜搜</li></a>
<a target="blank" href="http://www.souhu.com"><li>搜狐</li></a>
<a target="blank" href="http://www.3g.qq.com"><li>QQ</li></a>
<a target="blank" href="http://www.taobao.com"><li>淘宝</li></a>
<a target="blank" href="http://www.jd.com"><li>京东</li></a>
</ul>
</h2>
<!-- src添加图片地址,.代表当前文件所在文件夹,..表示当前文件所在文件夹的 上层文件夹 -->
<img src="./a/1.jpg" alt="图片描述">
<!-- alt表示对图片的描述,这里有占位的作用,也利于SEO(搜索引擎) -->
<img src="./a/1.jpg" alt="图片描述">
</body>
</html>
这样便可编辑出网页标头,其实只要条理清晰便不会很繁琐,只需注意区分样式中要编辑的对象,以及<body>中命令父子关系的罗列表达即可。到今天的学习便可制作简单的网页了。
附件:http://down.51cto.com/data/2368367
相关文章推荐
- 1,2,3,5,7,8,10,11,12,13,14,15,16,21,22 -》1~3,5,7~8,10~16,21~22
- 启动3个线程,线程1打印1到5,线程2打印5到10,线程3打印11到15,然后线程1打印16到20,以此类推。。。打印到30为止
- java 输入一个矩阵,按照从外向里以顺时针的顺序依次打印出每一个数字,例如,如果输入如下矩阵: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 则依次打印出数字1,2,
- 现有杂乱无序的1-20二十个数,这二十个数为:1,18,4,13,6,10,15,2,17,3,19,7,16,8,11,14,9,12,5,20,试依次求出相邻四个数之和的最大和最小值
- 60}的C程序 高手帮忙写下`` 46 35 27 21 16 10 9 5 然后输出数组a。已知 int a[11]={1 使数组a仍然有序 将x插入到有序整型数组a中 由键盘输入一个整数x
- 10 11 16 出状况了
- |1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20所有这些字符串,把它的数字一个个剥离??
- 输入一个矩阵,按照从外向里以顺时针的顺序依次打印出每一个数字,例如,如果输入如下矩阵: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 则依次打印出数字1,2,3,4,8
- 输入一个矩阵,按照从外向里以顺时针的顺序依次打印出每一个数字,例如,如果输入如下矩阵: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 则依次打印出数字1,2,3,4,8
- 输入一个矩阵,按照从外向里以顺时针的顺序依次打印出每一个数字,例如,如果输入如下矩阵: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 则依次打印出数字1,2,3,4,8,12,16,15,14,13,9,5,6,7,11,10.
- 输入一个矩阵,按照从外向里以顺时针的顺序依次打印出每一个数字,例如,如果输入如下矩阵: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 则依次打印出数字1,2,3,4,8
- C语言:求1+1/2+1/4+1/7+1/11+1/16+1/22+…的值,直到最后一项的值小于10的-5次幂
- 启动三个线程,线程1打印1-5,线程2打印6-10,线程3打印11-15,接着线程1打印16-20……依此类推,打印到72.
- Effective C++ Item 10,11 Have assignment operators return a reference to *this Handle assignment to self in operator =
- Mysql中,int(10)和int(11)的区别
- 2016-2017 ACM-ICPC, Egyptian Collegiate Programming Contest (ECPC 16)【solved:9 / 11】
- 输入12,从1到12这些整数中包含1 的数字有1,10,11和12,1一共出现了5次。
- sitecore 16/8/11
- !金尚网上商城10~11-业务逻辑分析+逻辑(编码)设计
- 12-24更新:下载Mozilla firefox 10 beta1和11 alpha2