Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

149
Views
hide second div of a particular p tag using css

I want to hide the second div after this div, there is no identifier for that div.

That's why I took this p tag attribute as an identifier. I tried using jQuery, but in page load it's sometimes visible. Is there any way to hide it permanently?

div p[data-udy-fe="text_-a91032"] {
    
}

I'm adding my jQuery code here, but when page loading we can see the div's content for some seconds. I need to hide it permanently, without the brief flash.

$("p").each(function(){        
    if($(this).attr('data-udy-fe') == 'text_-a91032') {
        $(this).next('div').next('div').hide();
    }
});
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You can use + div + div selector

p[data-udy-fe="text_-a91032"]+ div + div {
  display: none;
}
<div>
  <div>Paragraph1</div>
  <div>Paragraph2</div>
  <p data-udy-fe="text_-a91032">Paragraph3</p>
  <div>Paragraph4</div>
  <div>this one is not displayed</div>
  <div>Paragraph6</div>
<div>

about 4 years ago · Juan Pablo Isaza Report

0

You can use the general sibling combinator to select the p tag which occurs after your specific element.

div p[data-udy-fe="text_-a91032"] ~ p {
     display: none;
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!