You should define your containers outside the media query, and hide them if the width don't allow them to show.
#advertisementslot1, #advertisementslot2 {
box-shadow: 0px 0px 0px 4px rgba (255,255,0,0.9);
border-radius:16px;
opacity:0.8;
width:160;
height:600px;
position:absolute;
right:30px;
}
#advertisementslot1 {
top: 475px;
}
#advertisementslot2 {
top: 1095px;
}
@media only screen and (max-width: 1151px) {
#advertisementslot1, #advertisementslot2 {
display: none;
}
}