Search code examples
htmlcsstags

How to avoid a new line with the 'p' tag


How can I stay on the same line while working with the <p> tag?

I want to create a carousel with an image and text.


Solution

  • Use the display: inline CSS property.

    Ideal: In the stylesheet:

    #container p { display: inline }
    

    Bad/Extreme situation: Inline:

    <p style="display:inline">...</p>