Questions tagged «html»

HTML(超文本标记语言)是用于创建网页和其他要在Web浏览器中显示的信息的主要标记语言。有关HTML的问题应包括一个可重现的示例,以及您要实现的目标的一些想法。此标记很少单独使用,通常与[CSS]和[javascript]配对使用。



11
如何修复getImageData()错误画布已被跨域数据污染?
我的代码在localhost上运行良好,但在站点上不运行。 我从控制台收到此行的错误.getImageData(x,y,1,1).data: Uncaught SecurityError: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data. 我的代码的一部分: jQuery.Event.prototype.rgb=function(){ var x = this.offsetX || (this.pageX - $(this.target).offset().left),y = this.offsetY || (this.pageY - $(this.target).offset().top); if (this.target.nodeName!=="CANVAS")return null; return this.target.getContext('2d').getImageData(x,y,1,1).data; } 注意:我的图片网址(src)来自子域网址

12
如何自动将文本框设置为大写?
我正在使用以下样式属性将用户输入设置为大写,以便例如在用户开始在文本框中输入内容时railway,应将其更改为大写字母,RAILWAY 而无需用户按下Caps-lock按钮。 这是我用于输入的代码: <input type = "text" class = "normal" name = "Name" size = "20" maxlength = "20"> <img src="../images/tickmark.gif" border="0" style='text-transform:uppercase'/> 但是我没有通过使用此属性获得所需的输出。
131 html 

12
我收到favicon.ico错误
我下载了Netbeans IDE以HTML进行编码。我是新来的。当我运行代码时,chrome正在打开,并且一切正常。我在输出-浏览器日志中遇到某种错误。 Failed to load resource: net::ERR_EMPTY_RESPONSE (20:00:55:963 | error, network) at http://localhost:8383/favicon.ico 我如何解决它?
131 html  netbeans 

4
具有内联样式的CSS伪类
Наэтотвопросетьответына 堆栈溢出нарусском:Какпрописать:hoverвнутриstyle =''? 是否有可能使用内联样式的伪类? 例: <a href="http://www.google.com" style="hover:text-decoration:none;">Google</a> 我知道上述HTML不能正常运行,但是有类似的东西吗? 附言:我知道我应该使用外部样式表,但确实如此。我只是好奇是否可以使用内联样式来完成。

18
如何检测同一文件的输入类型=文件“更改”?
我想在用户选择文件时触发一个事件。.change如果用户每次都更改文件,则事件将起作用。 但是,如果用户再次选择相同的文件,我想触发该事件。 用户选择文件A.jpg(事件触发) 用户选择文件B.jpg(事件触发) 用户选择文件B.jpg(事件不触发,我希望它触发) 我该怎么做?

17
AngularJS错误:跨源请求仅支持以下协议方案:http,数据,chrome扩展名,https
我有一个非常简单的angular js应用程序的三个文件 index.html <!DOCTYPE html> <html ng-app="gemStore"> <head> <script src='https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js'></script> <script type="text/javascript" src="app.js"></script> </head> <body ng-controller="StoreController as store"> <div class="list-group-item" ng-repeat="product in store.products"> <h3>{{product.name}} <em class="pull-right">{{product.price | currency}}</em></h3> </div> <product-color></product-color> </body> </html> product-color.html <div class="list-group-item"> <h3>Hello <em class="pull-right">Brother</em></h3> </div> app.js (function() { var app = angular.module('gemStore', []); app.controller('StoreController', function($http){ this.products …



7
我应该在CSS或HTML中将图像作为data / base64嵌入吗
为了减少服务器上的请求数量,我将一些图像(PNG和SVG)作为BASE64直接嵌入到CSS中。(在构建过程中自动执行) 像这样: background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAFWHRTb2Z0d2FyZQBBZG etc...); 这是一个好习惯吗?有什么理由可以避免这种情况?是否有一些不支持数据URL的主流浏览器? 额外的问题:对CSS和JS这样做也有意义吗?
130 html  css  base64 

5
为什么我不能保证金居中:0自动?
我有一个#headerdiv,100% width在该div内,我有一个无序列表。我已经申请margin: 0 auto无序列表,但不会在标头div中居中。 有人可以告诉我为什么吗?我认为,如果定义父div的宽度,那么无序列表应该可以以居中margin: 0 auto。我想念什么? 这是我的代码: <style> * { margin: 0; padding: 0; } #header { width: 100%; background-color: #333; min-height: 160px; font-family:Arial, Helvetica, sans-serif; } #sitename { font-size: 50px; width: 620px; margin:0 auto; padding-top: 35px; color:#999; } #header ul { float: right; margin: 0 auto; } #header …
130 html  css  margin 

5
在HTML5画布上绘制SVG文件
是否有将SVG文件绘制到HTML5画布上的默认方法?Google Chrome支持将SVG加载为图像(并简单地使用drawImage),但是开发者控制台会对此进行警告resource interpreted as image but transferred with MIME type image/svg+xml。 我知道将SVG转换为canvas命令的可能性(就像在这个问题中一样),但是我希望这不是必需的。我不在乎较旧的浏览器(因此,如果FireFox 4和IE 9支持某些功能,那就足够了)。
130 html  canvas  svg 

10
如何在VI中整理HTML文件的缩进?
我该如何解决他所有乱七八糟的html文件的缩进? 我尝试了通常的"gg=G命令,该命令用于修复代码文件的缩进。但是,它似乎不适用于HTML文件。它只是删除了所有格式。 我还尝试了set :filetype = xml,看看是否欺骗它以为这是一个XML文件会有所帮助,但仍然没有做到。
130 html  vim  vi  indentation 

5
错误:无法在“节点”上执行“ appendChild”:参数1不是“节点”类型
我正在尝试将图像拖放到div上。图像没有被拖到div上并给出以下错误 Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.draganddrop.html:20 dropdraganddrop.html:26 ondrop 码 <!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>Creativity Dashboard</title> <!-- Required CSS --> <link href="css/movingboxes.css" rel="stylesheet"> <link href="css/compare.css" rel="stylesheet"> <!--[if lt IE 9]> <link href="css/movingboxes-ie.css" rel="stylesheet" media="screen"> <![endif]--> <!-- Required script --> …
130 javascript  html 

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.