CSS 样式超链接

CSS styling a hyperlink

我正在尝试将某种样式应用到锚标记 <a> 但没有成功,我想在第一个六边形中创建一个具有其他六边形样式的 URL。我需要在其他六边形中将 MyURL 样式设置为 "This is a title"。

  <li>
    <div>
    <img src="https://farm3.staticflickr.com/2878/10944255073_973d2cd25c.jpg" alt="" />
      <h1><a href="#">MyURL</a></h1>
      <p>Some sample text about the article this hexagon leads to</p>
    </div>
  </li>

(已解决)笔 -> http://codepen.io/anon/pen/PZNWGN

这基于以下线程:

Responsive grid of hexagons

谁能帮帮我?

在所有其他 exagon 中,标题在 :

<h1>Title</h1>

但在第一个中,您将标题放在 a 标签中,如下所示:

<a href="#">This is a title</a>

这会导致问题

它继承了 position:absolute #categories li * 的样式。通过添加覆盖它:

#categories li h1 * { position: relative; }

或者,将 #categories li * 替换为更具体的内容。