diff --git a/html/Ocean.std-theme/ocean.css b/html/Ocean.std-theme/ocean.css
index 16d867341d77a009be2ee519536070f3a80ed86a..3fb799cb3a977f64082a55f3f9d71424b9453723 100644
--- a/html/Ocean.std-theme/ocean.css
+++ b/html/Ocean.std-theme/ocean.css
@@ -19,9 +19,9 @@ p { margin: 0.5em 0; }
 ul { margin-left: 2em; }
 
 a { text-decoration: none; }
-a:link { color: rgb(196,69,29); }
-a:visited { color: rgb(171,105,84); }
-a:hover { text-decoration:underline; }
+a[href]:link { color: rgb(196,69,29); }
+a[href]:visited { color: rgb(171,105,84); }
+a[href]:hover { text-decoration:underline; }
 
 /* @end */
 
diff --git a/src/Haddock/Backends/Xhtml.hs b/src/Haddock/Backends/Xhtml.hs
index eae90bd461568454e80c22584d82b67446fac90c..4bd355ae2c9cbe714fc4966efbc51c411631563a 100644
--- a/src/Haddock/Backends/Xhtml.hs
+++ b/src/Haddock/Backends/Xhtml.hs
@@ -606,7 +606,7 @@ numberSectionHeadings exports = go 1 exports
 
 processExport :: Bool -> LinksInfo -> Bool -> (ExportItem DocName) -> Maybe Html
 processExport summary _ _ (ExportGroup lev id0 doc)
-  = nothingIf summary $ groupTag lev << namedAnchor id0 << docToHtml doc
+  = nothingIf summary $ groupTag lev ! [identifier id0] << docToHtml doc
 processExport summary links unicode (ExportDecl decl doc subdocs insts)
   = processDecl summary $ ppDecl summary links decl doc insts subdocs unicode
 processExport summary _ _ (ExportNoDecl y [])