当前位置:网站首页>区块元素、内联元素(<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这个地方变成红色。
边栏推荐
- 从DES走到AES(现代密码的传奇之路)
- The original question on the two sides of the automatic test of the byte beating (arranged according to the recording) is real and effective 26
- Android studio connects to MySQL and completes simple login and registration functions
- H5如何实现唤起APP
- Matlab paper illustration drawing template No. 41 - bubble chart (bubblechart)
- MySQL 字符串拼接 - 多种字符串拼接实战案例
- [QNX Hypervisor 2.2用户手册]9.18 unsupported
- el-input can only input integers (including positive numbers, negative numbers, 0) or only integers (including positive numbers, negative numbers, 0) and decimals
- swinIR论文阅读笔记
- Google 安装印象笔记剪藏插件
猜你喜欢
公司不重视软件测试,新来的阿里P8给我们撰写了测试用例编写规范
The original question on the two sides of the automatic test of the byte beating (arranged according to the recording) is real and effective 26
What do interview test engineers usually ask?The test supervisor tells you
navicat无法连接mysql超详细处理方法
腾讯注册中心演进及性能优化实践
Google Chrome(谷歌浏览器)安装使用
IOT物联网概述及应用层架构入门篇
PDF file conversion format
选择黑盒测试用例设计方法的综合策略方案总结
Detailed explanation of the software testing process (mind map) of the first-tier manufacturers
随机推荐
[QNX Hypervisor 2.2用户手册]9.20 vdev
【热题】LeetCode 热题 HOT 100分类+题解
大屏UI设计-看这一篇就够了
在 .NET MAUI 中如何更好地自定义控件
MySQL 8.0.29 设置和修改默认密码
【语义分割】FCN
18年程序员生涯,读了200多本编程书,挑出一些精华分享给大家
Detailed explanation of the software testing process (mind map) of the first-tier manufacturers
【QT】Qt Creator生成动态库(DLL)并调用
Mysql return table
Go语言中定时任务库Cron使用详解
RADIUS 如何提高 WiFi 无线网络安全性?
Mysql common commands
Go语言之interface详解
ELK log analysis system
2022年7月学习计划完成情况
系统(层次)聚类
MySQL 用户授权
编译失败:HBuilderX 安装目录不能包括 ( 等特殊字符 (HBuilderX,uni-app报错)
Google 安装印象笔记剪藏插件