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

Viewed 336769

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.

5 Answers

Use the display: inline CSS property.

Ideal: In the stylesheet:

#container p { display: inline }

Bad/Extreme situation: Inline:

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

The <p> paragraph tag is meant for specifying paragraphs of text. If you don't want the text to start on a new line, I would suggest you're using the <p> tag incorrectly. Perhaps the <span> tag more closely fits what you want to achieve...?

Something like

p
{
    display: inline;
}

in your stylesheet would do it for all p tags.

Related