I want to put a <p>
tag into my headline, I have tried to do it this way but the <p>
tags are not shown in the header:
<h1> <p>I want to see the p tags!</p> </h1>
How can I force the <p>
tags into the header string?
I want to put a <p>
tag into my headline, I have tried to do it this way but the <p>
tags are not shown in the header:
<h1> <p>I want to see the p tags!</p> </h1>
How can I force the <p>
tags into the header string?
Nothing.
<h1>
elements may not have <p>
element descendants.
See the specification which says that the h*
elements Content model is "Phrasing content", which does not include p
elements.
<h1><p>
is not meaningful markup. It cannot be header and a paragraph. What are you trying to do? If you simply want the header to be styled in the same way as the paragraph then add some styles. An example inline would be:
p, h1 {
font-size: 0.7em;
font-weight: normal;
}
this will make both <h1>
and <p>
the same.
whatever
"? – Jakob Nov 23 '17 at 13:28` element is irrelevant to the problem and you are asking a duplicate of https://stackoverflow.com/questions/2820453/display-html-code-in-html
– Quentin Nov 23 '17 at 13:29