Page 1 of 1

Stop underlining everything?

Posted: Mon Mar 14, 2016 1:46 pm
by whoami
Hey.

So I was browsing MM2X, you know, for the old times' sake. And I noticed that in the downloads section, when you hover over anything, everything gets underlined.

I checked it out, and it seems it's because of this CSS rule:

Code: Select all

A:hover {BACKGROUND: none; COLOR: #CCCCCC; FONT-SIZE: 10px; FONT-FAMILY: Verdana, Helvetica; TEXT-DECORATION: underline}
So all the <a> tags in the page get underlined when hovered. <a> tags are usually links, so that's fine. But on MM2X, the pages use this:

Code: Select all

<a> <stuff> </a>
These aren't links, they're like name indicators. So when you open modules.php#someNameHere, it scrolls down automagically to the someNameHere tag.

For example, here, I scroll down to the Chicago Golden Edition Race Mod V2 (as of this writing):

https://www.mm2x.com/modules.php?name=Downl ... d=117#1416

Now, all the main content in the page is wrapped in a tag <a>, so all the main content is part of this tag. So when we hover over any of this content, it gets underlined.

One fix would be to change the CSS rule from a:hover to a[href]:hover - the href attribute tells the link where to go, and in the case of the <a> ones here, there's no href tag, so all the normal links would get underlined, while none of the other content - that isn't in a link - would.

Thanks. :D

Posted: Mon Mar 14, 2016 2:20 pm
by RohitXL5
Great find! 8)

Posted: Mon Mar 14, 2016 9:21 pm
by Franch88
Thanks for this find, but I don't know, I don't see it happening. :roll: How does it happen for you, precisely?

Posted: Thu Mar 17, 2016 5:50 am
by whoami


Here's a before and after.

Also, sorry for the late response, I forgot to check for any. Silly me.

Posted: Mon Apr 18, 2016 2:48 am
by Midas
Yup, I also noticed this. Better change the HTML code so there is no <a> tag at all.