Fork me on GitHub
Subscribe 3

Ticket #644 (fixed bug)

Chrome styles target anchors like links

  • Created: 2012-03-21 21:35:48
  • Reported by: Franz
  • Assigned to: Franz
  • Milestone: 1.4.9
  • Component: styling
  • Priority: normal

Chrome styles target anchors like links

As they have no targets, these "links" should not look like clickable links - Chrome seems to treat them differently. So we should either explicitly change the markup or the styling. Not sure which is better?


arw 2012-03-22 19:45:58

it's sad there is no : { *:inherit!important; }

and since users could do anything to style link, that would do some css ( font, text-decoration,text-transform, color, ... ) if it should be perfect

so i think "id" would be better, but "maintenance, ranks, signatures, censoring" may be too "global", they should be specialized ( for example with option_maintenance, ... )

Franz 2012-03-22 20:09:58

I think we should just not wrap the form label inside the anchor, as that's not necessary. Just not sure whether there are any possible downsides...

arw 2012-03-22 20:27:36

no downside, it's what is done in help page for "smilies" and "img"

Comment edited 3 times (Diff, Diff 2, Diff 3)

Swyter 2012-03-27 16:11:57

  • Uploaded patch _anchor.diff. (view)

Also incorrectly styled in Firefox 11+
Anchors in Firefox

And here you have! The golden grail of correctness:

Following that I've made my first patch.
It works, but I don't know if the diff format is the right one. So please be kind. smile

I've been following you guys by RSS and thought that maybe you could find it useful. Great work, by the way.

Swyter 2012-03-27 17:08:44

  • Uploaded patch _anchor.diff. (view)

Okay, now I see that you've to generate them with

diff -u <old> <new> > output

Sorry, I'm new at this thingie. smile

- - - - -
Edit: Maybe using ids on the parent instead can do the trick.
Also is syntactically cleaner.

Comment edited 3 times (Diff, Diff 2, Diff 3)

Swyter 2012-03-27 17:23:20

  • Uploaded patch _swy_anchorfix.admin_options.php.diff. (view)

This one removes the anchor tags and replaces them with ids on their parents. Same functionality, you can refer them with the hash. Less clutter. Easier, backwards-compatible styling.

Both patches are correct, though.

arw 2012-03-27 19:00:10

franz was hinting at doing :

<th scope="row"><a name="target"></a>String</th>

name attribute to <a> tag is deprecated in xhtml1.0 ( link ), and in html4 they warn that "User agents should be able to find anchors created by empty A elements, but some fail to do so."  ( link )

if id are used, there is already <form id="censoring" ...> so fragments should be changed

Franz 2012-04-03 21:41:22

Commit 788870e to fluxbb fluxbb-1.4

Merge pull request #37 from Etana/fluxbb-1.4#644

Ticket #644: Target anchors are styled like links.

Franz 2012-04-03 21:56:40

  • Owner set to Franz.
  • Status changed from open to fixed.

Franz 2012-04-03 21:57:22

Thank you for the pull request, and also thanks @Swyter for the patches - sorry, but the way it's done now was the easier solution.

Thanks for contributing, guys! smile