Make new line without using
in HTML

前端 未结 7 1355
时光取名叫无心
时光取名叫无心 2021-02-02 10:58

I want to make each one of these element is different line, without using
in HTML,

is block element but I have to fix its

相关标签:
7条回答
  • 2021-02-02 11:36

    Use CSS:

    a {
      display: block;
    }
    

    By default a tag is an inline element, so you have to change its display property.

    From the CSS specification:

    Block-level elements are those elements of the source document that are formatted visually as blocks (e.g., paragraphs). The following values of the 'display' property make an element block-level: 'block', 'list-item', and 'table'.

    http://www.w3.org/TR/CSS2/visuren.html#block-boxes

    Inline-level elements are those elements of the source document that do not form new blocks of content; the content is distributed in lines (e.g., emphasized pieces of text within a paragraph, inline images, etc.). The following values of the 'display' property make an element inline-level: 'inline', 'inline-table', and 'inline-block'. Inline-level elements generate inline-level boxes, which are boxes that participate in an inline formatting context.

    http://www.w3.org/TR/CSS2/visuren.html#inline-boxes

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