Using media query with each property

Suppose I have a div which is to be displayed only above lg screens. I have a button inside that div. Should I use lg with each property of the button or not?
<div className="hidden lg:block">
<button className="text-white w-max hover:bg-green-800 py-4 px-6 rounded-md">
Contact sales
</button>
<!-- other content -->
</div>
<div className="hidden lg:block">
<button className="text-white w-max hover:bg-green-800 py-4 px-6 rounded-md">
Contact sales
</button>
<!-- other content -->
</div>
2 Replies
Chris Bolson
Chris Bolson3mo ago
no. Defining it on the parent element is enough.
ABUL KALAM
ABUL KALAMOP3mo ago
Understood. Thanks
Want results from more Discord servers?
Add your server