How to find content without a specific tag

Asked

Viewed 49 times

1

I’m in a situation where I need to find content without a specific tag. Of course any content is surrounded by a tag, even if it’s body or html. With the example becomes clearer what I need:

<div class='texto'>
<p>Essa imagem é muito bonita!</p>
<img src='imagens.png'/>
Foi tirada em Munique, Alemanha
</div>

In case, I need to stylize equal manner the two texts, both of which are involved by a p, how much is thrown directly into the div. Because when I need to use attributes in css like line-height or other things like that, the styling doesn’t look cool. I wanted to see how best to select this content loose in div

  • 1

    Where does this text come from? can’t you fix it on the server? or in the html document directly?

1 answer

4


Example : Any formatting that div father have the daughters will inherit.

<div class='texto'>
<p>Essa imagem é muito bonita!</p>
<img src='imagens.png'/>
Foi tirada em Munique, Alemanha
</div>
<style>
.texto{
	font-size:20px;
	color: #006633;
	}
</style>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.