Likely, you'll want to differentiate between screen sizes, rather than whether or not it's a mobile browser.
As commented, you'll be better off using css media queries. One of the existing css frameworks, such as bootstrap, can be a good way to achieve this, but you don't have to use a framework.
@media (max-width: 1024px) {
div.myClass {
display: none;
}
}
Will make an item hidden on small screens (including mobile devices).
@media (min-width: 1024px) {
div.myClass {
display: none;
}
}
Will make something hidden on large screens. From there, mix and match to achieve whatever effect you're after.
On bootstrap, you've got helper-classes such as visible-md-block
and hidden-xs
to fine-tune visibility on various screen sizes. See Bootstrap docs for more info on that bit.