为什么我的链接在i元素中不起作用?

时间:2015-10-28 18:21:23

标签: html html5 hyperlink font-awesome

为什么我的链接不起作用?

<section id="contact">
        <div class="container">
            <div class="row">
                <div class="col-lg-8 col-lg-offset-2 text-center">
                    <h2 class="section-heading">Let's Get In Touch!</h2>
                    <hr class="primary">
                    <p>Ready to turn your idea into reality? Let's work together! Send me an email or give me a ring, and I will get back to you as soon as possible!</p>
                </div>
                <div class="col-md-4 text-center">
                    <a href="mailto:erichoonpark@gmail.com"><i id="contact" class="fa fa-envelope-o fa-3x wow bounceIn" data-wow-delay=".1s"></i></a>
                    <p>Email</p>
                </div>
                <div class="col-md-4 text-center">
                    <a href="https://www.linkedin.com/pub/eric-park/30/19a/778"><i id="contact" class="fa fa-file-text-o fa-3x wow bounceIn" data-wow-delay=".1s"></i></a>
                    <p>LinkedIn</p>
                </div>
                <div class="col-md-4 text-center">
                    <a href="tel://+12135981088"><i id="contact" class="fa fa-phone fa-3x wow bounceIn"></i></a>
                    <p>213-598-1088</p>
                </div>
            </div>
        </div>
    </section>

我在github页面中有这个部分与我联系,但当我点击图标时......我收到404错误。我的HTML有什么问题?

1 个答案:

答案 0 :(得分:0)

正如Fasoeu所说:你需要在&lt; a&gt;之间放置文本,然后将其作为链接显示。标签!不在下面!

<section id="contact">
  <div class="container">
    <div class="row">
      <div class="col-lg-8 col-lg-offset-2 text-center">
        <h2 class="section-heading">Let's Get In Touch!</h2>
        <hr class="primary">
        <p>Ready to turn your idea into reality? Let's work together! Send me an email or give me a ring, and I will get back to you as soon as possible!</p>
      </div>
      <div class="col-md-4 text-center">
        <a href="mailto:erichoonpark@gmail.com"><i id="contact" class="fa fa-envelope-o fa-3x wow bounceIn" data-wow-delay=".1s">Email</i></a>
      </div>
      <div class="col-md-4 text-center">
        <a href="https://www.linkedin.com/pub/eric-park/30/19a/778"><i id="contact" class="fa fa-file-text-o fa-3x wow bounceIn" data-wow-delay=".1s">LinkedIn</i></a>
      </div>
      <div class="col-md-4 text-center">
        <a href="tel://+12135981088"><i id="contact" class="fa fa-phone fa-3x wow bounceIn">213-598-1088</i></a>
      </div>
    </div>
  </div>
</section>

如果您打算使链接文本显示为斜体,我建议您使用CSS来完成此操作!像这样:

<a href="example.com" style="font-style: italic;">link-text</a>

甚至更好:

HTML:

<a href="example.com" class="italic">link-text</a>

CSS:

.italic {
  font-style: italic;
}

现在班级中的每个元素都是&#34;斜体&#34;将有斜体字体。