一些小巧的HTML,CSS和JS问题 [英] A few little finicky HTML, CSS and JS issues

查看:98
本文介绍了一些小巧的HTML,CSS和JS问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的尝试可在 http://bit.ly/S4je19 查看



问题1:上传按钮应向下移动约5像素,以与选择图片文件输入内联。



问题2:名称,邮政编码和电子邮件基本上都是内联的

问题3:在jsfiddle上的绝对提交按钮,它的应该,它的复选框和tick文本是内联的。在服务器上关闭jsfiddle,提交按钮与复选框和勾选文本在一起,并且复选框高于tick文本而不是内联?为什么?



问题4:下载和prinst链接。下载链接应该自动下载(跨浏览器),但不会为所有浏览器?打印链接应该自动(跨浏览器)使用打印对话框打开文件,但是同样不会对所有浏览器都打开?我的代码是在我的jsfiddle的JS区域。



谢谢!



Dave

解决方案

1。问题1:



  #BrowserVisible {
background:url('http://www.joelandamywedding.com/images /upload.JPG')100%5px no-repeat;
height:32px;
}



2。问题2& 3:



使用CSS重置。 规范化 Eric Meyer的。或者如果你不确定,你可以使用这个,但它不解决一切:

  * {margin:0; padding:0; list-style:none;} 



3。问题4:



在您的服务器端,请提供标题: Content-disposition:attachment;



从浏览器打印PDF:



您可以使用JavaScript从浏览器与读取器通信显示文件。
我在一个问题中找到了另一种方法可能值得尝试:

 < html> 
< script language =javascript>
timerID = setTimeout(exPDF.print();,1000);
< / script>
< body>
< object id =exPDFtype =application / pdfdata =111.pdfwidth =100%height =500/>
< / body>
< / html>

想法是在浏览器中使用javascript指示PDF阅读器打印文件。此方法适用于嵌入HTML页面的PDF文件。


My attempts are viewable on http://bit.ly/S4je19

Issue 1: The upload button should be moved down about 5px to be inline with the "select image" file input. I can't seem to get it to move that drop down, why?

Issue 2: Name, Postcode and Email sit basically inline (end at the same area) on jsfiddle, but when uploaded to the server they don't?

Issue 3: On jsfiddle the absolute submit button on the bottom right does what it should, and the checkbox and "tick" text are inline. On the server off jsfiddle, the submit button sits inline with the checkbox and tick text and the checkbox sits higher than the "tick" text rather than inline? Why?

Issue 4: The download and prinst links. The download link should automatically download (cross-browser) but won't for all browser? The print link should open the file with a print dialog automatically (cross-browser) but again won't for all browsers? My code is in the JS area of my jsfiddle. This should work for any browser - maybe someone can provide a better solution?

Thanks!

Dave

解决方案

1. Issue 1:

#BrowserVisible {
    background: url('http://www.joelandamywedding.com/images/upload.JPG') 100% 5px no-repeat;
    height: 32px;
}

2. Issue 2 & 3:

Use a CSS Reset. Either Normalise or Eric Meyer's. Or if you are not sure, you can use this, but it doesn't solve everything:

* {margin: 0; padding: 0; list-style: none;}

3. Issue 4:

In your server side, please give the header: Content-disposition: attachment; in order to force browsers to download instead of viewing inline.

Printing a PDF from the browser:

You can use JavaScript from the browser to communicate with the reader that shows the file. I found this other approach in a question that might worth trying:

<html>
<script language="javascript">
timerID = setTimeout("exPDF.print();", 1000);
</script>
<body>
<object id="exPDF" type="application/pdf" data="111.pdf" width="100%" height="500"/>
</body>
</html>

The idea is to use javascript in the browser to instruct the PDF reader to print the file. This approach will work on PDF files embedded in a HTML page.

这篇关于一些小巧的HTML,CSS和JS问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆