img上的href链接无法正常工作

时间:2014-07-23 06:54:51

标签: html css

您好我有以下代码,几乎没有链接到图像,但它没有显示链接也没有重定向到page.yes我把我们放在正确的目录,如我的菜单

my menu

<li><a href="about_us.html">About Us</a>
                                    <ul>
                                        <li><a href="team.html">Team</a></li>
                                                <li><a href="location.html">Location</a></li>
                                                <li><a href="careers.html">Careers</a></li>
                                    </ul>
                                </li> 

HTML:

<a href="about_us.html"><img class="ls-s2"  src="images/slides/xichlofrontvideo.png" alt="" style="position: absolute; top: 100px; left: 60px; slidedirection : bottom; slideoutdirection : bottom;  durationin : 1000; durationout : 750; easingin : easeInOutQuint; easingout : easeInBack; delayin : 500; delayout : 0; showuntil : 0; "></a>
<a href="about_us.html"><img class="ls-s2"  src="images/slides/cap_a1.png" alt="" style="position: absolute; top: 160px; left: 600px; slidedirection : top; slideoutdirection : top;  durationin : 2000; durationout : 750; easingin : easeInOutQuint; easingout : easeInBack; delayin : 500; delayout : 0; showuntil : 0; "></a>
<a href="about_us.html"><img class="ls-s2"  src="images/slides/cap_a2.png" alt="" style="position: absolute; top: 290px; left: 600px; slidedirection : right; slideoutdirection : right;  durationin : 2500; durationout : 750; easingin : easeInOutQuint; easingout : easeInBack; delayin : 500; delayout : 0; showuntil : 0; "></a>
<a href="about_us.html"><img class="ls-s2"  src="images/slides/cap_a3.png" alt="" style="position: absolute; top: 410px; left: 600px; slidedirection : bottom; slideoutdirection : bottom;  durationin : 3000; durationout : 750; easingin : easeInOutQuint; easingout : easeInBack; delayin : 500; delayout : 0; showuntil : 0; "></a>
<a href="about_us.html"><img class="ls-s2"  src="images/slides/cap_a3.png" alt="" style="position: absolute; top: 410px; left: 750px; slidedirection : bottom; slideoutdirection : bottom;  durationin : 3500; durationout : 750; easingin : easeInOutQuint; easingout : easeInBack; delayin : 500; delayout : 0; showuntil : 0; "></a>

5 个答案:

答案 0 :(得分:4)

检查您的“about_us.html”文件是否在正确的目录中。如果没有重定向,则可能不在正确的目录中。

您正在使用href="about_us.html",这意味着“about_us.html”文件必须与放置a标记的文件位于同一目录中。

您可能应该查看相对和绝对网址。这可能会对您有所帮助:

答案 1 :(得分:1)

您的代码文件与about_us.html在同一目录中吗?如果没有,请修改它。

images/目录也是如此。

答案 2 :(得分:1)

您的图像也可能位于条形图后面。为此,您可以使用z-index属性。 使用此:

a {
   position: absolute;
   z-index: 9999;
}

答案 3 :(得分:0)

http://jsfiddle.net/ej4ac/

什么不起作用?

不能重定向吗?

<a href="about_us.html"><img class="ls-s2"  src="images/slides/xichlofrontvideo.png" alt="" style="position: absolute; top: 100px; left: 60px; slidedirection : bottom; slideoutdirection : bottom;  durationin : 1000; durationout : 750; easingin : easeInOutQuint; easingout : easeInBack; delayin : 500; delayout : 0; showuntil : 0; "></a>
            <a href="about_us.html"><img class="ls-s2"  src="images/slides/cap_a1.png" alt="" style="position: absolute; top: 160px; left: 600px; slidedirection : top; slideoutdirection : top;  durationin : 2000; durationout : 750; easingin : easeInOutQuint; easingout : easeInBack; delayin : 500; delayout : 0; showuntil : 0; "></a>
            <a href="about_us.html"><img class="ls-s2"  src="images/slides/cap_a2.png" alt="" style="position: absolute; top: 290px; left: 600px; slidedirection : right; slideoutdirection : right;  durationin : 2500; durationout : 750; easingin : easeInOutQuint; easingout : easeInBack; delayin : 500; delayout : 0; showuntil : 0; "></a>
            <a href="about_us.html"><img class="ls-s2"  src="images/slides/cap_a3.png" alt="" style="position: absolute; top: 410px; left: 600px; slidedirection : bottom; slideoutdirection : bottom;  durationin : 3000; durationout : 750; easingin : easeInOutQuint; easingout : easeInBack; delayin : 500; delayout : 0; showuntil : 0; "></a>
            <a href="about_us.html"><img class="ls-s2"  src="images/slides/cap_a3.png" alt="" style="position: absolute; top: 410px; left: 750px; slidedirection : bottom; slideoutdirection : bottom;  durationin : 3500; durationout : 750; easingin : easeInOutQuint; easingout : easeInBack; delayin : 500; delayout : 0; showuntil : 0; "></a>

我猜你的about_us.html不在正确的目录路径中,因为根据上面的jsfiddle,你的代码效果很好,并且href正在工作。

答案 4 :(得分:0)

尝试在网址之前插入href标记:<a href="/about_us.html"></a>