0

我之前已经看到过这个问题,但是我在对我的网站应用修复时遇到了麻烦。我正在构建一个投资组合网站,并添加了使用:hover和 CSS 转换的导航元素。我一直在跨浏览器测试该网站,虽然它在桌面浏览器上运行良好,但移动 Safari 拒绝合作(点击悬停在移动 Chrome 和移动 IE 中运行良好)。在 iPhone 或 iPad 上,导航完全失效。如果有人可以提供帮助,将不胜感激。网站是:www.gabeweintraub.com。相关代码如下:

:这是我的第一个Web项目,所以我假设代码中除了这个之外还有一堆令人尴尬的漏洞问题。请温柔。)

HTML

  <div class="splash_nav">
        <ul>
            <li><span>Ideas</span>
                <ul>
                    <li><a href="/cgi-bin/blosxom.cgi">Blog</a></li>
                    <li><a href="http://twitter.com/GabeWeintraub">Twitter</a></li>
                </ul>
            </li>
            <li><span>Projects</span>
                <ul>
                    <li><a href="/gallery.html" >Art</a></li>
                    <li><a href="/code.html" >Code</a></li>
                </ul>
            </li>
            <li><span>About</span>
                <ul>
                    <li><a href="/bio.html">Bio</a></li>
                    <li><a href="/resume.html">Resume</a></li>
                    <li><a href="/contact.html">Contact</a></li>
                </ul>
            </li>
        </ul>
    </div>
</div>

<nav>

        <div class="menu-item-2">
            <h4>Ideas</h4>
            <ul>
                <li><a href="/cgi-bin/blosxom.cgi">Blog</a></li>
                <li><a href="http://twitter.com/GabeWeintraub">Twitter</a></li>
            </ul>
        </div>


        <div class="menu-item-2">
          <h4>Projects</h4>
          <ul>
            <li><a href="/gallery.html">Art</a></li>
            <li><a href="/code.html">Code</a></li>
          </ul>
        </div>


        <div class="menu-item-3">
          <h4>About</h4>
          <ul>
            <li><a href="/bio.html">Bio</a></li>
            <li><a href="/resume.html">Resume</a></li>
            <li><a href="/contact.html">Contact</a></li>
          </ul>
        </div>
    </nav>

CSS

.splash_nav {
  width: 500px;
  position: relative;
  top: 300px;
  margin: 0 auto 2em;
  padding: 0;
  text-align: center;
}


.splash_nav li {
  display: inline;
  list-style: none;
}

.splash_nav li span {
  display: inline;
  list-style: none;
  text-transform: uppercase;
  text-decoration: none; 
  color: rgb(152,27,30);
  font-size: 1.5em;
  font-weight: 500;
  height: 100px;
  padding: 10px;
}

.splash_nav li a {
  display: inline;
  text-transform: uppercase;
  text-decoration: none; 
  color: rgb(152,27,30);
  font-weight: 500;
  height: 100px;
}

.splash_nav li ul {
  display: none;  
}

.splash_nav li:hover ul, .splash_nav li.hover ul {
  position: fixed;
  display: block;
  height: 80px;
  width: 500px;
  top: 340px;
  margin: 0 auto 0;
  text-align: center;
}

.splash_nav li:hover li, .splash_nav li.hover li {
  position: relative;
  -webkit-animation: fadeIn 2s;
    -moz-animation: fadeIn 2s;
    -ms-animation: fadeIn 2s;
}

.splash_nav li:hover li a, .splash_nav li.hover li a {
  color: rgb(76,77,79);
  font-size: 1em;
  padding: 10px;
}

.splash_nav li li a:hover {
  background: #eee;
}

@-webkit-keyframes fadeIn {
    from { opacity: 0; }
      to { opacity: 1; }
}

@-moz-keyframes fadeIn {
    from { opacity: 0; }
      to { opacity: 1; }
}

@-ms-keyframes fadeIn {
    from { opacity: 0; }
      to { opacity: 1; }
}

nav {
  float: right;
  line-height: 1.5;
  padding-right: 70px;
}

.menu-item-1, .menu-item-2, .menu-item-3 {
  background: #fff;

}

.menu-item-1 h4, .menu-item-2 h4, .menu-item-3 h4 {
  color: rgb(152,27,30);
  font-size: 1.5em;
  font-weight: 500;
  text-align: right;
}


.menu-item-1 h4 a, .menu-item-2 h4 a, .menu-item-3 h4 a {
  color: rgb(152,27,30);
  display: block;
  text-decoration: none;
  text-align: right;
  text-transform: uppercase;
}

/*ul Styles*/
.menu-item-2 ul, .menu-item-3 ul {
  background: #fff;
  font-size: 1em;
  line-height: 30px;
  height: 0px;
  list-style-type: none;
  overflow: hidden;

  text-transform: uppercase;

  /*Animation*/
  -webkit-transition: height 1.5s ease;
     -moz-transition: height 1.5s ease;
       -o-transition: height 1.5s ease;
      -ms-transition: height 1.5s ease;
          transition: height 1.5s ease;
}


.menu-item-3:hover ul {
  height: 93px;
}

.menu-item-2:hover ul{
  height: 62px;
}

.menu-item-2 ul a, .menu-item-3 ul a {
  width: 150px;
  text-decoration: none;
  color: rgb(76,77,79);
  display: block;
  text-align: right;
  padding-right: 20px;
}

/*li Styles*/
.menu-item-2 li, .menu-item-3 li {
  border-bottom: 1px solid color: rgb(76,77,79);;
  text-align: right;
}

.menu-item-2 li:hover, .menu-item-3 li:hover {
  background: #eee;
  text-align: right;
  text-decoration: none;
}

谢谢!

4

0 回答 0