1
I’m having trouble editing some legacy Ivs. Let’s take a look at the example:
This is the current code:
<div id="conteudo">
<div class="titulo">xxx</div>
<div class="texto">xxx</div>
<div class="antesDepois">xxx</div>
<div class="autor">xxx</div>
<div class="tags">xxx</div>
<div class="comentários">xx</div>
</div>
All right, in view of this, the css of these Ivs is already done. Only the Conteudo div is putting everything inside a single box. I was wondering if it’s possible for me to "split" this box in half.
For example, before the div class="antesAfter" i would like to put a division. Then put a division again in the div class"author" and so on.
Then you tell me, but man.. Just you close the div content that and open a new div before the beforeAfter.. Just not, I can’t, because Divs are inheriting a lot of stuff from the contents.. And there’s a lot of stuff...
I know I should have done this before, but I’m editing a code that’s already been produced..
So there’s BIG DOUBT. I can do something about it?
Can you explain better what you mean by "split in half"? Have you tried
nth-child
?– Sergio
And you can’t close and open another
div
with classconteudo
. So the other elements will continue to inherit whatever.– Miguel Angelo
@Miguelangelo Wow, it’s true.. This will solve my problems for now..
– maxxzag
I submitted it as an answer then... since that is acceptable. If you encounter a problem that prevents you from using this solution, just leave a comment and I’ll change the answer.
– Miguel Angelo
@maxxzag can answer my question above?
– Sergio
@Sergio Claro, let’s say that the div "content" has a css with background-color: #00; therefore, all the other Ivs are also with this background. I wish there was a divider between the Divs "text" and "beforeAfter". But I couldn’t do it just by changing the background because there was padding involved, margin and other things.. And I wish these things weren’t included in the Ivs. Miguel’s response helps because I create another div with the same class and these continue with the inheritance they had.
– maxxzag
use a parent div as container for your separation, then you can leave the behavior from the above item, ie your container.
– Luan Fagundes
But didn’t you say you couldn’t change the HTML? or got it wrong here: "Just not, I can’t, because the Ivs are inheriting various things from the content divide.. " ?
– Sergio