【问题标题】:Header issue on mobile手机上的标题问题
【发布时间】:2016-02-05 08:10:28
【问题描述】:

网站是http://www.oahu-hawaii-luau.com/ 我的标题不会出现在小型移动屏幕上,但是当我缩小桌面窗口时我可以看到它。 所以看来问题只出在 Mobile 和 Safari 上。该问题出现在小于 984 像素的屏幕上。

我的标志头代码是:

.logo-logobg {
    position: absolute;
    min-width: 300px;
    min-height: 1260px;
    width: 100%;
    z-index: 1000;
    background: url(images/logo-logobg.png) left top no-repeat;
}

我将问题缩小到移动导航。错误在此代码中,但仍然无法弄清楚到底是什么:

.nav-mobile {
    display:block;

}
.nav {
    width:100%;
    padding:0px 0 0 0;
    position:absolute;
    z-index:999999;
    top:53px;

}
.nav-list {
    display:none;
}
.nav-item {
    width:100%;
    float:none;
    background-image:none;
    padding-bottom:0px;
}
.nav-item:hover {
    background-image:none;
    padding-bottom:0px;
}
.nav-item > a {
display:block;
color:#ffffff;
padding:8px 16px;
text-decoration:none;
font-size:14px;
border-bottom:1px solid #276815;
margin:0px;


height:auto;
line-height:normal;

border-radius:0px;
}

【问题讨论】:

  • 可以附上截图吗?在我的 chrome 模拟器上看起来不错
  • 在 Chrome 上可以,但在 Safari 上不行
  • @Parlanchina 这个网站有很多问题。看起来您正在使用 ASP Web 表单,将页面包装在表单标签中是残酷的。您还会在页面中间而不是在标题中注入一堆 CSS。还有使用像<div align="center"> 这样的折旧或过时标记的问题。在 DIV 上使用 align 现在已过时。浏览器供应商很慷慨,并继续允许这样的标记工作,但没有义务这样做。如果这是一个新网站,我强烈建议您使用 HTML5 并复习有效的标记和实践。

标签: css


【解决方案1】:

把这个放在你的脑海里:<meta name="viewport" content="width=device-width">

【讨论】:

  • 谢谢,但我不确定 与它有什么关系。我的标题中也有
  • 您的视口元标记在 body 元素第 45 行。它应该在 head 元素中
  • 您还在使用 HTML5 标记时声明了 HTML 4.0 过渡文档类型
  • 你说得对,这是网站上的问题之一。但是经过测试它并没有解决上述问题。不过谢谢。
猜你喜欢
  • 1970-01-01
  • 2019-04-24
  • 2017-10-18
  • 2015-01-04
  • 1970-01-01
  • 2017-02-01
  • 2018-02-25
  • 2011-08-08
  • 1970-01-01
相关资源
最近更新 更多