How can I put DIV in P?

前端 未结 6 1414
陌清茗
陌清茗 2020-11-29 08:41

How can I put div in paragraph? I changed the display to inline, but the browser divide the base paragraph to two element, and div will not member of paragraph.

6条回答
  •  再見小時候
    2020-11-29 08:52

    no you cannot nest anything other than an inline element in a

    if you want the code to validate

    from the property def:

    I know it's hard to understand those recs at times, but the bit in brackets means the

    can only contain inline elements

    you can (and should) use a inside a

    and if required you could change it's CSS display property to block or inline-block and that would be perfectly valid, as CSS properties do not change the actual definitions of an element.. in your case it sounds like you need an inline element so just use a

提交回复
热议问题