当前位置:网站首页>区块元素、内联元素(<div>元素、span元素)
区块元素、内联元素(<div>元素、span元素)
2022-08-02 05:03:00 【五彩大铁猿】
目录
HTML<div>元素
HTML区块元素:
eg:<h1><p><ul><table>
HTML内联元素:
eg:<b>加粗 <td><a><img>
具体点击下面这条链接
(27条消息) HTML 区块元素_csdn123t的博客-CSDN博客_html 区域元素
HTML<div> 元素
- HTML <div> 元素是块级元素,它可用于组合其他 HTML 元素的容器。
- <div> 元素没有特定的含义。除此之外,由于它属于块级元素,浏览器会在其前后显示折行。
- 如果与 CSS 一同使用,<div> 元素可用于对大的内容块设置样式属性。
- <div> 元素的另一个常见的用途是文档布局。它取代了使用表格定义布局的老式方法。使用 <table> 元素进行文档布局不是表格的正确用法。<table> 元素的作用是显示表格化的数据。
具体代码实现:
<div style="border:1px dashed red;width:500px;margin-bottom:50px;position: relative;left: 400px;">
同样的我们将下面的表格、列表也划分到一个区块上。
完整代码如下 :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My first web page</title>
</head>
<body>
<div style="border:1px dashed red;width:500px;margin-bottom:50px;position: relative;left: 400px;">
<h2>LY python 练习</h2>
<h3>hahahaahhahhahahaha</h3>
<p>hello world ,练习web加油加油,<span style="color:red">LY</span></p>
<a href="https://blog.csdn.net/weixin_47314602?type=blog" target="_blank">小渣渣主页面</a>
<br/>
<img src="C:\Users\1\Pictures\Saved Pictures\aa.jpg" width="100">
</div>
<div style="border:1px dashed red;width:500px;margin-bottom:50px;position: relative;left: 400px;">
<table border="1" cellpadding="5">
<tr>
<th>data1</th>
<th>data2</th>
<th>data3</th>
</tr>
<tr>
<td>11</td>
<td>22</td>
<td>33</td>
</tr>
<tr>
<td>111</td>
<td>222</td>
<td>333</td>
</tr>
</table>
<ol>
<li>情深缘浅</li>
<li>情非得以</li>
<li>纸短情长</li>
</ol>
<ol start="10">
<li>说散就散</li>
<li>绿色</li>
<li>三生三世</li>
</ol>
<ul>
<li>我曾</li>
<li>鼓楼先生
<ul>
<li>汉斯</li>
<li>男</li>
<li>32</li>
</ul>
</li>
<li>寒鸦少年</li>
</ul>
</div>
</body>
</html>
展示图:
span元素
- HTML <span> 元素是内联元素,可用作文本的容器
- <span> 元素也没有特定的含义。
- 当与 CSS 一同使用时,<span> 元素可用于为部分文本设置样式属性。
在这一段代码上加上span
<p>hello world ,练习web加油加油,<span style="color:red">LY</span></p>
<div style="border:1px dashed red;width:500px;margin-bottom:50px;position: relative;left: 400px;">
<h2>LY python 练习</h2>
<h3>hahahaahhahhahahaha</h3>
<p>hello world ,练习web加油加油,<span style="color:red">LY</span></p>
<a href="https://blog.csdn.net/weixin_47314602?type=blog" target="_blank">小渣渣主页面</a>
<br/>
<img src="C:\Users\1\Pictures\Saved Pictures\aa.jpg" width="100">
</div>
展示图我们可以看到LY这个地方变成红色。
边栏推荐
- SQL数据表增加列
- CNN 理解神经网络中卷积(大小,通道数,深度)
- mysql练习题
- Redis常见题型
- 认识CAN光纤转换器的光纤接口和配套光纤线缆
- MYSQL unique constraint
- C language: Check for omissions and fill in vacancies (3)
- The company does not pay attention to software testing, and the new Ali P8 has written a test case writing specification for us
- canvas 像素操作(图片像素操作)
- ELK log analysis system
猜你喜欢
随机推荐
从DES走到AES(现代密码的传奇之路)
去字节跳动自动化测试二面原题(根据录音整理)真实有效 26
navicat新建数据库
golang泛型
MYSQL unique constraint
Matlab学习第二天
Redis-集群模式(主从复制模式,哨兵模式,集群化模式)
系统(层次)聚类
MySQL(7)
matlab simulink 飞机飞行状态控制
Towhee 每周模型
Go语学习笔记 - grpc serverclient protobuf 从零开始Go语言
Js数据类型转化之数组的join方法
行测不会概念
ORA-04044:此处不允许过程、函数、程序包或类型,系统分析与解决
12个MySQL慢查询的原因分析
golang的time包:时间间隔格式化和秒、毫秒、纳秒等时间戳格式输出的方法
RADIUS 如何提高 WiFi 无线网络安全性?
ELK日志分析系统
go语言中的goroutine(协程)