- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在我的网站上创建了 CSS 移动菜单,它在我的笔记本电脑上运行良好。当我在 680px 下最小化笔记本电脑上的浏览器时,默认菜单变成了移动菜单,但在智能手机上不能那样工作,它会保留默认菜单。我做错了什么?
/* CSS Document */
body{
font-family: 'Prompt', Sans-serif;
background-image: url(wallpaper.png);
background-color:#ECCB6C;
background-repeat: no-repeat;
background-attachment: fixed;
margin: 0;
padding: 0;
text-align: center;
}
header{
background-image:url(logo.png);
background-repeat:no-repeat;
background-position:bottom left;
width:60%;
height:220px;
margin:0 auto;
padding:0;
}
nav{
width:70%;
height:auto;
margin:0 auto 3px auto;
background-image:url(hfbkg.png);
padding:0 80px 0 80px;
}
nav ul{
overflow:hidden;
padding:0;
text-align:center;
margin:0;
transition:max-height 0.4s;
-webkit-transition:max-height 0.4s;
-ms-transition:max-height 0.4s;
-moz-transition:max-height 0.4s;
-o-transition:max-height 0.4s;
}
nav ul li{
display:inline-block;
padding:5px 7px;
}
nav ul li:hover{
background-color:#FFFFFF;
}
.handle {
width:100%;
text-align:left;
box-sizing:border-box;
padding:15px 10px;
cursor:pointer;
color:#FFFFFF;
display:none;
}
@media screen and (max-width: 680px){
nav ul{
max-height:0;
}
.showing{
max-height:20em;
}
nav ul li{
box-sizing:border-box;
width: 100%;
padding:15px 0px;
margin:0;
text-align:left;
}
.handle{
display:block;
}
}
@media (max-width:680px){
#kontakt{
width:100%;
}
#iframe{
width:100%;
}
}
section{
width:70%;
height:auto;
background-image:url(textbkg.png);
line-height:1.5em;
font-size:1.1em;
padding:60px 80px;
margin:0 auto;
clear:both;
}
section a:link {
color:#000000;
}
section a:hover {
text-decoration: none;
color:#FFAE00;
}
section a:visited {
text-decoration: none;
color:#000000;
}
#textarea{
width:350px;
height:200px;
padding:2px;
margin:5px;
}
#ime{
width:350px;
height:20px;
padding:2px;
margin:5px;
}
#email{
width:350px;
height:20px;
padding:2px;
margin:5px;
}
#decoupauge img{
margin:1%;
border: thick solid;
with: 15px;
color: #353439;
padding:2px;
}
#ukrasi img{
margin:1%;
border: thick solid;
with: 15px;
color: #353439;
padding:2px;
}
#sponzori{
margin:5%;
align-content:center;
}
#kontaktobr{
width:400px;
height:auto;
margin:20px 0;
padding:10px;
float:left;
}
#iframe{
float:right;
margin:20px 0;
padding:10px;
}
#adresa { /* pošto su iframe i kontakt obrazac u floatu u adresi ne smije biti float zato što adresa razvlači section background do footera */
width:410px;
height:auto;
margin:10px;
padding:20px;
}
#adresa p {
margin:0px;
padding:0;
}
#adresa a:link{
color:#000000;
text-decoration: none;
}
#adresa a:hover{
text-decoration: none;
color:#FFAE00;
}
footer{
width:70%;
height:auto;
margin:3px auto 0 auto;
background-image:url(hfbkg.png);
padding:5px 80px;
text-align:end;
color:#FFFFFF;
clear:both;
}
footer a:hover{
color:#FBEE9A;
}
a{
margin:0;
}
a:link {
color: #FFFFFF;
text-decoration: none;
}
a:visited {
text-decoration: none;
color:#FFFFFF;
}
a:hover {
text-decoration: none;
color:#363539;
}
a:active {
text-decoration: none;
color: #363539;
}
p{
text-align:justify;
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Index</title>
<link rel="stylesheet" href="style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=Prompt" rel="stylesheet">
<style type="text/css">
body,td,th {
font-family: Prompt, Sans-serif;
}
</style>
</head>
<body background="wallpaper.png">
<header>
</header>
<nav>
<ul>
<a href="index.html"><li>Početna</li></a>
<a href="terapija.html"><li>Terapije</li></a>
<a href="galerija.html"><li>Glerija</li></a>
<a href="donacije.html"><li>Donacije</li></a>
<a href="linkovi.html"><li>Linkovi</li></a>
<a href="kontakt.html"><li>Kontakt</li></a>
</ul>
<div class="handle">Menu</div>
</nav>
<section>
<h3><strong>O nama</strong></h3>
<p> Udruga je počela sa radom 2013. godine..</p>
</section>
<script>
$('.handle').on('click', function(){
$('nav ul').toggleClass('showing');
});
</script>
<footer>
<a>Copyright 2016</a>
</footer>
</body>
</html>
最佳答案
您没有定义视口(viewport)?
在 <head>
中需要一个元标记工作:
<meta name="viewport" content="width=device-width, initial-scale=1" />
关于css - 手机菜单不显示在手机上,只显示在桌面上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39701583/
这显然有可能导致一场激烈的 war ,但无论如何,我试一试……(目前)还没有任何明确的答案。 在我的一台机器上,我确实被切换/升级到 Matlab 2012b。这是一个漂亮的新桌面,好吧。但出于很多原
当我的 Docker 容器启动时,我收到以下通知: Docker Desktop has detected that you shared a Windows file into a WSL 2 co
我希望能够(从服务器)连接到远程 PC 并能够访问其文件。我正在尝试使用 PHP 或 JavaScript 来完成此操作。 所以我想知道 1) 是否可能以及 2) 如何做到。 有人有任何示例/解决方案
我想使用 DirectX 为 Windows 7 制作动画桌面背景。我正在使用 C#、SlimDX 和几个 Windows API 函数的 P/Invoke 导入。我对 native Windows
是否可以为 Mac 开发动态桌面?我所说的“动态”是指其图像采用系统参数(例如时间和作业信息)并使用此信息来更新图像的桌面。有关图像状态的信息也将在 session 之间保留。我不是在谈论电影或随机但
我正在 LibGDX 中构建一个仅限桌面的应用程序。该游戏内置了一个 map 编辑器,您可以切换到并更改游戏 map 。我想添加一个功能,如果用户单击关闭窗口并且有未保存的编辑,它会提示您是否要在关闭
有没有像样的Windows桌面JSON lines (JSONL)格式查看器? 这种格式也称为: 行分隔的 JSON (LDJSON) 换行符分隔的 JSON (NDJSON) 我正在寻找至少能够从
我有一个UITableView,它在单元格中显示大量图像,并且我对滚动性能并不满意。我的 UITableView 类似于 iPhone 上的照片应用程序。有谁知道为什么 iphone 照片应用程序滚动
let img1 = document.createElement('img'); img1.setAttribute('src', 'https://caniuse.com/img/browsers
我在同一窗体上有两个不同的网格控件。它们共享相同的上下文菜单。当我选择上下文菜单项时,我无法确定哪个控件是所有者。 最佳答案 ContextMenuStrip 类的 SourceControl 属性将
我已经安装了 Docker Desktop ( version : 2.3.0.4 ) 并启用了 Kubernetes . 我部署了几个 PODS,一切正常,从昨天开始,我遇到了下面提到的一个奇怪的问
我正在制作需要实现TableView的应用程序。 我想将背景图像应用到桌面 View 。 谁能帮我解决这个问题。我正在使用下面的代码来创建 TableView Titanium.UI.setBackg
我在同一窗体上有两个不同的网格控件。它们共享相同的上下文菜单。当我选择上下文菜单项时,我无法确定哪个控件是所有者。 最佳答案 ContextMenuStrip 类的 SourceControl 属性将
您能建议一些库在我的桌面 Java 应用程序中创建雷达图吗? 谢谢 最佳答案 似乎JFreeChart提供了SpiderWebPlot 。 images for which看起来像雷达图。 关于jav
这个问题已经有答案了: 已关闭10 年前。 Possible Duplicate: Not possible to launch a file on a network using Java Desk
就目前情况而言,这个问题不太适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、民意调查或扩展讨论。如果您觉得这个问题可以改进并可能重新开放,visit
我想知道是否可以(使用JAVA)识别用于发出请求的计算机类型,例如:服务器、台式机、PDA(平板电脑、手机等)? 谢谢! 最佳答案 取决于您使用什么来接受请求。对于 http 请求,信息位于请求 he
我添加了一个事件处理程序,用于滚动到我的桌面 View ,但它仅在我使用滚轮滚动时才起作用,但我也需要它在您单击并拖动滚动条时起作用。任何想法有什么问题吗?我尝试使用不同的方法来处理该事件,但没有一个
我想开始开发桌面 Java 应用程序,并且我想知道 Java 社区使用什么。 我从 Swing 开始,但发现它非常初级。 我习惯于在 Visual Studio 2010 中使用 .net c# WP
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,
我是一名优秀的程序员,十分优秀!