You need to apply the class so that the following code applies to only one div.

<style> div { -webkit-box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.6); -moz-box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.6); box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.6); padding: 10px; -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; background: #eeece0; } </style> <div> <p>qweqwe text qweqwe text qweqwe test1 qweqwe text qweqwe text qweqwe test2 qweqwe text qweqwe text qweqwe test3</p> </div> 
  • The fact is that all my divs are placed in these blocks - Kamilplus

2 answers 2

Option number one: set the collector from the "parent" to the immediate descendant - an example . Even if there is no parent as such, then body can be used as its

 <style> #parent > div { -webkit-box-shadow: 0px 0px 3px rgba(0,0,0,0.6); -moz-box-shadow: 0px 0px 3px rgba(0,0,0,0.6); box-shadow: 0px 0px 3px rgba(0,0,0,0.6); padding: 10px; -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; background: #eeece0; } </style> <div id="parent"> <div> <p> qweqwe text qweqwe text qweqwe test1 qweqwe text qweqwe text qweqwe test2 qweqwe text qweqwe text qweqwe test3 </p> <div>INNER DIV</div> <div>INNER DIV</div> </div> </div> 

Option number two: for this diva set either class or ID

  • Thank you !!!!! - Kamilplus 5:58 pm

Something like this.

 <style> .container { -webkit-box-shadow: 0px 0px 3px rgba(0,0,0,0.6); -moz-box-shadow: 0px 0px 3px rgba(0,0,0,0.6); box-shadow: 0px 0px 3px rgba(0,0,0,0.6); padding: 10px; -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; background: #eeece0; } </style> <div class="container"> <p> qweqwe text qweqwe text qweqwe test1 qweqwe text qweqwe text qweqwe test2 qweqwe text qweqwe text qweqwe test3 </p> </div>