html - Do @media queries still work on links when also using a:hover, a:visited, etc -
I have a stylesheet that has both queries on the media and one: hover, one: tour, etc. in one element and This is an element that does not work @ media queries apply but a CSS: hover and A: visited does not work. I am thinking that these elements can not work together or if there is an error in my code.
Here's my code:
#button {background-color: # 003794; Font-family: helvetica; font-weight: bold; Font size: 1.9em; Color: # 0045b9; Text-decoration: None; Text-Shadow: 0 pixels 5 pixels 5 pixels # 00266 9, 0 pixels 4 pixels 4 pixels # 002c78, 0 pixels 3px3px # 002E7A, 0 pixel 2 pixel 2 pixel # 00338a, 0 px1 pixels1 pixel # 00348b; } A: Visited {background-color: # 003794; Font-family: helvetica; font-weight: bold; Font size: 1.9em; Color: # 0045b9; Text-decoration: None; Text-Shadow: 0 pixels 5 pixels 5 pixels # 00266 9, 0 pixels 4 pixels 4 pixels # 002c78, 0 pixels 3px3px # 002E7A, 0 pixel 2 pixel 2 pixel # 00338a, 0 px1 pixels1 pixel # 00348b; } A: Hover {background-color: # 003794; Font-family: helvetica; font-weight: bold; Font size: 1.9em; Color: # 003794; Text-decoration: None; } @ Media all and (max-width: 50m) {# button {font-size: 1.5m; }} @ Media all and (max-width: 40.625 AM) {# button {font-size: 1.25em; }} @ Media all and (max-width: 35EM) {#button {font-size: 1em; }} << Code>
Change a: hover
to #button:
Hover. is not being applied due to a
rule because the #button
selector is more specific.
Your CSS can also be simplified:
# button {background color: # 003794; Font-family: helvetica; font-weight: bold; Font size: 1.9em; Color: # 0045b9; Text-decoration: None; Text-Shadow: 0 pixels 5 pixels 5 pixels # 00266 9, 0 pixels 4 pixels 4 pixels # 002c78, 0 pixels 3px3px # 002E7A, 0 pixel 2 pixel 2 pixel # 00338a, 0 px1 pixels1 pixel # 00348b; } # Button: visited {color: # 0045b9; } #button: hover {color: # 003794; } @ Media all and (max-width: 50m) {# button {font-size: 1.5m; }} @ Media all and (max-width: 40.625 AM) {# button {font-size: 1.25em; }} @ Media all and (max-width: 35EM) {#button {font-size: 1em; }}
Working here.
Comments
Post a Comment