For the complete css/html code sample, please visit: https://jsfiddle.net/menelaosbgr/jbnsd9hc/1/
Here are two specific definitions I am working with:
/* Dropdown Content (Hidden by Default) */
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 120px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
bottom: 0px;
right: 0px;
}
@media screen and (min-width: 480px) {
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 120px;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
z-index: 1;
bottom: 0px;
right: -50px;
}
}
I am looking to refactor the code for a more streamlined approach. I attempted the following, but encountered issues:
/* Dropdown Content (Hidden by Default) */
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 120px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
bottom: 0px;
right: 0px;
@media screen and (min-width: 480px) {
bottom: 0px;
right: -50px;
}
}
In essence, how can I rewrite the code to avoid redundancy?