I'm fairly new to HTML/CSS so excuse me if this is a simple question but my a:hover (using an id and not a class) isn't working inside an a href tag but when I use it in a th tag it does.懸停不起作用<a href> tag
HTML
<a href='http://www.example.com' id='link1'>Example Text</a>
CSS
#link1 a:hover {
text-decoration: none;
color: #E0E0E0;
}
The thing is that if I put it in a div and set it as a class instead of an id, it works but then moves the rest of the links afterward down a line on the page.
我想這可能是因爲你正在尋找一個「A」鏈接裏面的#鏈接1。試試#link1:懸停也許。 – ncdreamy