常用的html标签汇总、以及操作过程中的一些bug问题解决方法,以下龙腾飞网络科技-小吴在建站实操中笔记记录,一路走来,一步步学习、总结、整理的一些资料,不用死记硬背,保存使用非常方便,实操过程中遇到了就查询搜索一下,实践出真章,做多了自然就熟悉了:
【定义和用法】
p标签定义段落。
浏览器会自动在每个 p 元素前后添加一个空行。
提示:请使用 CSS 设置段落样式。
【实例】
例子 1
像这样标记段落:
<p>龙腾飞网络科技致力于建立企业发展无缝对接的服务体系!</p>
例子 2
对齐段落中的文本(使用 CSS):
<p style="text-align:right">龙腾飞网络科技致力于建立企业发展无缝对接的服务体系!</p>
例子 3
使用 CSS 设置段落样式:
<html><head><style>p { color: navy; text-indent: 30px; text-transform: uppercase;}</style></head><body><p>China, officially the People's Republic of China (PRC),is a country in East Asia. It is the world's second-most-populous country, with a population exceeding 1.4 billion. China spans the equivalent of five time zones and borders fourteen countries by land.With an area of nearly 9.6 million square kilometers (3,700,000 sq mi), it is the third-largest country by total land area. The country is divided into 22 provinces,five autonomous regions, four municipalities, and two semi-autonomous special administrative regions. Beijing is the national capital, while Shanghai is the most populous city and largest financial center.</p></body></html>
例子 4
更多段落:
<p>在源代码中, 这一段 包含很多行, 但浏览器 忽略它。</p>
例子 5
HTML 中的诗歌问题:
<p> 朝辞白帝彩云间, 千里江陵一日还。 两岸猿声啼不住, 轻舟已过万重山。</p>
【默认的 CSS 设置】
大多数浏览器将使用以下默认值显示 p 元素:
p { display: block; margin-top: 1em; margin-bottom: 1em; margin-left: 0; margin-right: 0;}