Search code examples
htmlcssparagraphtext-formatting

Paragraph inside Anchor cannot be formated


while working i messed HTML because i did not knew that <p> tag within <a> tag does not get formated .

Like if i had :

<a>
 <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, </p>
</a>

where <a> parent width is 200px; text goes through 200px; instead of putting New Lines to fit the text inside .


Solution

  • try to make

    a {
    display: block;
    }