When to use instead

?

前端 未结 12 1891
故里飘歌
故里飘歌 2020-11-30 20:53

As the question indicates, if I have some text that I want to add in the HTML then when should I use

and when should I use ?<

相关标签:
12条回答
  • 2020-11-30 21:43

    The p tag denotes a paragraph element. It has margins/padding applied to it. A span is an unstyled inline tag. An important difference is that p is a block element when span is inline, meaning that <p>Hi</p><p>There</p> would appear on different lines when <span>Hi</span><span>There</span> winds up side by side.

    0 讨论(0)
  • 2020-11-30 21:50

    A span is an inline formatting element that does NOT have a line feed above or below.

    A p is a block element that HAS an implied line feed above and below.

    http://w3schools.com/tags/default.asp

    0 讨论(0)
  • 2020-11-30 21:51

    When we are using normal text at that time we want <p> tag.when we are using normal text with some effects at that time we want <span> tag

    0 讨论(0)
  • 2020-11-30 21:51
    p {
        float: left;
        margin: 0;
    }
    

    No spacing will be around, it looks similar to span.

    0 讨论(0)
  • 2020-11-30 21:52

    Semantically, you use <p> tags to indicate paragraphs. <span> is used to apply CSS style and/or class(es) to an arbitrary section of text and inline elements.

    0 讨论(0)
  • 2020-11-30 21:52

    <span> is an inline tag, a <p> is a block tag, used for paragraphs. Browsers will render a blank line below a paragraph, whereas <span>s will render on the same line.

    0 讨论(0)
提交回复
热议问题