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

264
Views
Is there any way to change a <div> class basing on visitors' device?

I'm currently using my wordpress blog homepage with latest posts shown in 2 columns, which looks very nicely when visited by PC and Mac large screen but, at the same time, it's terrible when visited by mobile.

So I was wondering if I could use javascript or something else to change the <div> that splits the homepage into 2 column posts, into another <div> when visited not by large screens.

For example:

<script>
if ((!pc && !osx))
{ echo('<div class="half">';
}
else {echo('<div class="container">');
}
</script>

Any hint how to do?

about 4 years ago · Juan Pablo Isaza
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!