Adam Wojda
Adam Wojda

Reputation: 779

formatting any content without selector

I have :

<h3 class="maintitle">Here Text</h3>

I can add

<p></p>

<h3 class="maintitle"><p>Here Text</p></h3>

And format

.maintitle p {padding:10px;}




whether it is possible to do this without adding additional selector?

<h3 class="maintitle">Here Text</h3>

and

.maintitle <?> {padding:10px;}

I do not want to move content .maintitle ,only want to change the content inside without adding selectors

Upvotes: 0

Views: 36

Answers (1)

Antoine
Antoine

Reputation: 558

Do not sure if I understand what you want but if you simply do :

.maintitle {padding:10px;}

All elements with the attribute class="maintitle" will be affected by your CSS modifications : p, span, div, ...

OR :

h3 { padding:10px; }

...if you just want to set all your h3 padding

Upvotes: 1

Related Questions