Works

Tiramisu gummi bears faworki dragee. Faworki faworki dessert sweet. Souffle powder biscuit lemon drops topping wypas.

HTML
<div>
<p>Tiramisu gummi bears faworki dragee. Faworki faworki dessert sweet. Souffle powder biscuit lemon drops topping wypas.</p>
</div>

CSS

p:only-child {
	padding: 15px;
	background-color: #333;
	color: #fff;
}

Doesn't Work

Paragraph 1:Sweet icing applicake. Apple pie applicake bonbon cake danish cookie jujubes. Topping croissant tiramisu pie jelly-o pudding.

Paragraph 2: Oat cake pastry chocolate dessert brownie wafer candy. Caramels chocolate cake marzipan. Biscuit candy pudding dessert brownie dragee halvah donut gummi bears.

HTML
<div>
<p><strong>Paragraph 1:</strong>Sweet icing applicake. Apple pie applicake bonbon cake danish cookie jujubes. Topping croissant tiramisu pie jelly-o pudding.</p>

<p><strong>Paragraph 2:</strong> Oat cake pastry chocolate dessert brownie wafer candy. Caramels chocolate cake marzipan. Biscuit candy pudding dessert brownie dragee halvah donut gummi bears.</p>
</div>

CSS

p:only-child {
	padding: 15px;
	background-color: #333;
	color: #fff;
}

The styles are not applied as there are two <p> inside one parent.

Paragraph 1:Sweet icing applicake. Apple pie applicake bonbon cake danish cookie jujubes. Topping croissant tiramisu pie jelly-o pudding.

Blockquote: Oat cake pastry chocolate dessert brownie wafer candy.

HTML
<p><strong>Paragraph 1:</strong>Sweet icing applicake. Apple pie applicake bonbon cake danish cookie jujubes. Topping croissant tiramisu pie jelly-o pudding.</p>

<blockquote><strong>Blockquote:</strong> Oat cake pastry chocolate dessert brownie wafer candy.</p></blockquote>

CSS

p:only-child {
	padding: 15px;
	background-color: #333;
	color: #fff;
}

The styes are not applied as there <p> is not the only child of the parent, it also has <blockquote>.