我正在努力工作几个小时,为什么@media打印不起作用,我甚至在这个网站上搜索Google并没有任何帮助,所以这就是我发布这个问题的原因.我正在Google Chrome打印预览(ctrl p)上测试它,但我也打印到页面并且它保持空白.
我尝试在页面中创建一个单独的css文件和嵌入式CSS样式.
这是我的代码
头
<link rel="stylesheet" type="text/css" href="css/reset.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/print.css" media="print" />
Run Code Online (Sandbox Code Playgroud)
HTML
<div id="bruikleenovereenkomst">
<div id="blo_header">
</div>
<div id="blo_side_top"></div>
<div id="blo_side_bottom"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS正常样式
div#bruikleenovereenkomst {
width:595px;
height:842px;
background-color:#fff;
position:relative;
}
div#blo_header {
width:100%;
height:125px;
background-color:#FBE983;
z-index:9
}
div#blo_side_top {
width:57px;
height:420px;
background-color:#B6CAE5;
position:absolute;
right:0;
top:0;
z-index:99;
}
div#blo_side_bottom {
width:57px;
height:420px;
background-image:url(../images/leaflet.png);
background-repeat:no-repeat;
position:absolute;
right:0;
bottom:0;
z-index:99;
}
Run Code Online (Sandbox Code Playgroud)
CSS打印样式(print.css)注意:div#bruikleenovereenkomst只是一个用于测试的黑色块.
@media print{
body {
margin:0;
}
h1#logo {
display:none;
} …Run Code Online (Sandbox Code Playgroud) 我得到了以下对象
{
"20170007": {
"id": 1
},
"20170008": {
"id" : 2
},
"20170009": {
"id": 3
},
"20170010": {
"id": 4
}
}
Run Code Online (Sandbox Code Playgroud)
所需的输出:
{
"20170010": {
"id": 4
},
"20170009": {
"id": 3
},
"20170008": {
"id" : 2
},
"20170007": {
"id": 1
}
}
Run Code Online (Sandbox Code Playgroud)
我的尝试:
{
"20170007": {
"id": 1
},
"20170008": {
"id" : 2
},
"20170009": {
"id": 3
},
"20170010": {
"id": 4
}
}
Run Code Online (Sandbox Code Playgroud)
奇怪的部分是,当我控制台.log forEach 内的键时,键被反转。但是当我将键分配给 newObj 时,输出仍然是原始顺序......这里发生了什么?
编辑:
感谢您对我查看 Map …
我用Python控制树莓派2上的LED.我希望LED持续x秒.当我在Linux中设置环境变量时.例如,export t=5.LED亮起但不会熄灭.
如果我只是在python脚本中设置变量一切正常.
我在Linux中设置一个环境变量,如下所示:
export t=5
sudo python test.py
Run Code Online (Sandbox Code Playgroud)
并在Python中得到它:
#!/usr/bin/env python
import RPi.GPIO as GPIO
import time
import os
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11,GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(12,GPIO.OUT)
GPIO.output(12,0)
s = 0
t = os.environ.get('t')
while s <= t:
if (GPIO.input(11) == 1):
GPIO.output(12, 1)
time.sleep(0.1)
s += 0.1
else:
GPIO.output(12, 0)
GPIO.output(12, 0)
Run Code Online (Sandbox Code Playgroud) 有更好的方法吗?我需要在每个数组的末尾52 0,我已经尝试制作一个数组并将其内爆但是它的行为就像一个字符串.
for($i = 1; $i <= 52; $i++)
{
array_push($totaal["week".$i], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
Run Code Online (Sandbox Code Playgroud) 我在php中建立了一个网站,当我访问它时,它在网址中显示了一个会话ID.
http://pandhuishaaglanden.nl/wat_wij_verkopen.php?PHPSESSID=f4d91f171d85b4ccabbb8d06e29b7308
我不知道为什么或如何,因为谷歌认为这是SEO标准中的重复内容.
有人可以告诉我这是什么或如何.
我有一些奇怪的事情与php mail()函数.当我用PHP发送邮件时,它随机添加空格,一些浮动元素不起作用.
这些是我的标题:
$headers = 'From: ' . $website_naam . ' <' . $eigen_emailadres . '>' . PHP_EOL;
$headers .= 'Reply-To: ' . $naam_verzender . ' <' . $email_verzender . '>' . PHP_EOL;
$headers .= ($bcc_emailadres != '') ? 'Bcc: ' . $bcc_emailadres . PHP_EOL : '';
$headers .= 'X-Mailer: PHP/' . phpversion() . PHP_EOL;
$headers .= 'X-Priority: Normal' . PHP_EOL;
$headers .= 'MIME-Version: 1.0' . PHP_EOL;
$headers .= 'Content-type: text/html; charset=iso-8859-1' . PHP_EOL;
Run Code Online (Sandbox Code Playgroud)
这是我的信息:
$message = '<html><body style="font-family:Open Sans; …Run Code Online (Sandbox Code Playgroud)