html段落_HTML段落

HTML中的<p>元素用于创建段落,它是块级元素,包含文本内容。默认情况下,段落有首行缩进和行间距。段落可以通过align属性设置对齐方式,尽管在HTML5中已不推荐使用。style属性可用于内联样式,或通过外部CSS文件定义。<p>标签还支持全局属性。
摘要由CSDN通过智能技术生成

html段落

The HTML paragraph is given by the <p> element, that represents a paragraph. A paragraph generally is represented on the webpage as a block of text separated that has first-line indentation and spacing between the lines. In HTML, the paragraph could be a structural group having some relatable content, and the content could be an image or other fields.

HTML段落<p>元素给出,该元素表示一个段落。 段落通常在网页上表示为一个文本块,该文本块具有第一行缩进和行之间的间距。 在HTML中,该段落可以是具有一些相关内容的结构组,并且该内容可以是图像或其他字段。

A paragraph is a block-level element in HTML. It has a starting as well as an ending tag. The content of the paragraph is present between these two tags.

段落是HTML中的块级元素。 它具有开始标签和结束标签。 段落的内容位于这两个标签之间。

For example, a simple paragraph in HTML is given as follows:

例如, HTML中的一个简单段落如下:

    <p>this is paragraph.</p>

By default, the line break is available with the <p> tag. The text of the paragraph goes within the same line if the break element is not present.

默认情况下,换行符可通过<p>标签使用 。 如果不存在break元素,则段落的文本将位于同一行中。

For example, A paragraph without the BREAK element. It would give output as:

例如,没有BREAK元素的段落。 它将输出为:

    <p>here is a text with no breaking in the line</p>

The output would be as:

输出为:

here is a text with no breaking in the line

For example A paragraph with a BREAK element. It would give output as:

例如,带有BREAK元素的段落 。 它将输出为:

    <p> here is a text <br> with break <br> in the line <br> 
    as the BREAK element is present </p>

The output would be as:

输出为:

here is a text 
with no breaking
in the line
as the BREAK element is present

The paragraph element also has a margin for the text in the paragraph; this margin is present by default. The next line is given as soon as the paragraph ends.

段落元素段落中也有一个空白。 默认情况下存在此边距。 该段结束后立即给出下一行。

The paragraph ends could be ended automatically as soon as another <p> tag is encountered.

遇到另一个<p>标记时, 段落结尾可以自动结束。

Example:

例:

    <p> this is the first paragraph
    <p> this is the second paragraph

The output would be as:

输出为:

this is the first paragraph
this is the second paragraph

<p>标签的一些属性 (Some attributes of <p> tag)

align attribute: This specifies the alignment of the paragraph. The values of the align attribute are LEFT, RIGHT and CENTER. But this attribute has a limitation, that is not supported with the HTML5 version.

align属性 :这指定段落的对齐方式。 align属性的值为LEFT,RIGHT和CENTER。 但是此属性有一个限制,HTML5版本不支持该限制。

style attribute: The style attribute is used for providing the styling in line with the element. But it also could be given in the style element or by some external CSS file.

style属性 :style属性用于提供与元素一致的样式。 但是它也可以在style元素中或通过一些外部CSS文件给出。

Example with attributes:

具有属性的示例:

<p style =" display: block;  margin-top: 1em;  margin-bottom: 1em;  margin-left: 0; margin-right: 0;">
	Text here...
</p>

or

要么

<style> p {
    display: block;
    margin-top: 1em;
    margin-bottom: 1em;
    margin-left: 0;
    margin-right: 0;
}
</style>

The <p> tag supports the other global attributes in HTML.

<p>标记支持HTML中的其他全局属性。

翻译自: https://www.includehelp.com/html/html-paragraph.aspx

html段落

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值