禁止默认的右键菜单:

window.document.oncontextmenu = function(){ return false;}

WebBrowser 控件用法:(手动填充内容)

// 首先导航到空白页面
if (webBrowser1.Document != null)
    webBrowser1.Document.OpenNew(true);
else
    webBrowser1.Navigate("about:blank");
webBrowser1.Document.Write("<style type='text/css'>.e{color:tomato}.r{color:limegreen}</style>");
webBrowser1.Document.Write("<span class='e'>来个红色文字!</span><hr />");
webBrowser1.Document.Write("<span class='r'>来个绿色文字!</span><br />");

常用 html 编辑器:http://www.dcloud.io/

一个空框架( IE6下会假死 )

<!doctype html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Demo</title>
  <style type='text/css'>
    body{margin:0;padding:0;overflow-x:auto}
  </style>
  <script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
  <script>
    window.onresize=function(){Resize()}
    $(function(){Resize()})
    function Resize(){
      $('.main').height($(window).height()-$('#title').height())
      $('.left').height($('.main').height()-$('.date').height())
    }
  </script>
</head>
<body>
  <table id='title' style="width:100%;background:silver;">
    <tr>
      <td align="center">
        <div style="width:1260px;height:30px;line-height:30px;text-indent:20px;text-align:left;">
          标题
        </div>
      </td>
    </tr>
  </table>
  <div class='main' style="width:1260px;margin:0 auto;">
    <div class='left' style="width:190px;float:left;height:500px;border-right:1px dotted gray;border-left:1px dotted gray;">
      <div class='date' style="background:gray;width:190px;height:60px;position:absolute;bottom:0"></div>
    </div>
    <div class='main' style="width:1060px;margin-left:200px;overflow:auto">
      <div style="height:1000px;">一</div>
    </div>
  </div>
</body>
</html>

常用 javascript 格式化日期

<!doctype html>
<html>
 <head>
  <meta charset="UTF-8">
  <title>Document</title>
  <script src="js/jquery-1.12.4.min.js"></script>
  <script type="text/javascript">
    // 对Date的扩展,将 Date 转化为指定格式的String
    // 参照 https://msdn.microsoft.com/zh-cn/library/8kb3ddd4.aspx
    // 参照 http://blog.csdn.net/vbangle/article/details/5643091/
    // 月(M)、日(d)、小时(H)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
    // 年(y)可以用 1-4 个占位符,毫秒(f)只能用 1 个占位符(是 1-3 位的数字)
    // 例子:
    // (new Date()).Format("yyyy-MM-dd HH:mm:ss.f") ==> 2006-07-02 08:09:04.423
    // (new Date()).Format("yyyy-M-d H:m:s.f w")      ==> 2016-8-9 10:1:8.931 星期二
    Date.prototype.Format = function(fmt)
    {
      var o = {
        "M+" : this.getMonth()+1,                    //月份
        "d+" : this.getDate(),                       //日
        "H+" : this.getHours(),                      //小时
        "m+" : this.getMinutes(),                    //分
        "s+" : this.getSeconds(),                    //秒
        "f"  : this.getMilliseconds(),               //毫秒
        "w" : "星期"+"日一二三四五六"[this.getDay()],//星期
        "q" : Math.floor((this.getMonth()+3)/3)      //季度
      };
      if(/(y+)/.test(fmt))
        fmt = fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
      for(var k in o)
        if(new RegExp("("+ k +")").test(fmt))
          fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
      return fmt;
    }

    var time1 = new Date().Format("yyyy-MM-dd HH:mm:ss w");
    var time2 = new Date().Format("yyyy-MM-dd");
    $(function(){
      $('#t1').text(time1);
      $('#t2').text(time2);
    });
  </script>
 </head>
 <body>
  <div id="t1"></div>
  <div id="t2"></div>
 </body>
</html>

Razor 里如果要判断当前是否是调试模式输出,可以读取这个属性

HttpContext.Current.IsDebuggingEnabled

一段弹窗代码 详情可参考:http://www.w3help.org/zh-cn/causes/BX1053

<!doctype html>
<html>
 <head>
  <meta charset="UTF-8">
  <title>Demo</title>
 </head>
 <body>
   <input type="button" value="弹窗" onclick="showWindow()" /><br />
   <input type="text" value="普通 Input" /><br />
   <input type="text" value="只读 Input" readonly /><br />
   <input type="text" value="只读 Input" style="border:0" readonly /><br />
   <input type="text" value="禁用 Input" disabled />
   <input type="text" value="禁用 Input" style="border:0;background:#fff" disabled />
  <script type="text/javascript">
    function showWindow(){
      var win = window.open('',"",'height=200,width=400,top=200,left=200,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no, titlebar=no');
      win.document.write('具体消息');
      win.document.close();
    }
  </script>
 </body>
</html>

更多资源可参考:http://www.miniui.com/demo

[html]经验集的更多相关文章

  1. [转]Oracle 经验集

    -- 转换字符串为日期格式 to_date('2011-12-30 11:54:30','yyyy-MM-dd:hh24:mi:ss') Oracel 用 C# 连接,Microsoft 自带的 Sy ...

  2. [转]Windows 经验集

    Windows Server 2012 R2 显示 这台电脑 图标方法: 来自:https://jingyan.baidu.com/article/f25ef2544f6883482c1b82e5.h ...

  3. [转][Dapper]SQL 经验集

    condition.Append(" AND ChineseName like @name"); p.Add("@name", "%" + ...

  4. [java]经验集

    Calendar c = Calendar.getInstance(); c.set(1999,12,21); SimpleDateFormat sdf = new SimpleDateFormat( ...

  5. [Java.web][eclipse]经验集

    自动提示部分内容来自:http://www.cnblogs.com/mashuangying2016/p/6549991.html 使用 Eclipse 调试 Tomcat 的设置: Window - ...

  6. [转][c#]注册表经验集

    在 win7 64位的系统中,为了将程序做成绿化版(单EXE文件),一些设置准备放到 regedit(注册表)中. 测试时发现网上的 demo 可以读,但写的值调试不报错,相应位置却不存在,困扰了许久 ...

  7. [转]加密经验集 => C#

    下载地址 代码摘自 C#高级编程(第7版) 第579页 不对称加密

  8. [转]SQLite 经验集

    SQLite 的默认时间 转自:http://www.cnblogs.com/pennant/archive/2011/08/11/2134897.html select strftime('%Y-% ...

  9. [转]MySQL 经验集

    -- my.ini -> 在 [mysqld] 节点下加入一行 skip-grant-tables 然后重启服务 -- 接下来无密码登录到 mysql 执行以下命令 use mysql show ...

随机推荐

  1. zookeeper入门学习

    1.基本概念 ZooKeeper是一个分布式的,开放源码的分布式应用程序协调服务,是Google的Chubby一个开源的实现,是Hadoop和Hbase的重要组件.它是一个为分布式应用提供一致性服务的 ...

  2. WebView 调试

      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {            WebView.setWebContentsDeb ...

  3. git入门札记

    分布式版本控制(个人主机即版本库,有一台作为“中央服务器”来方便“交换”修改,管理修改 而非文件) vs.  SVN CVS git 安装后设置: git config - -global user. ...

  4. ppt 数组课后作业

    任务要求:随机生成10个数,填充一个数组,然后用消息框显示数组内容,接着计算数组元素的和,将结果也显示在消息框中. 设计思路:建一个数组,在for语句中将随机数存入数组中,然后每生成一个数就进行相加, ...

  5. Fisher vector for image classification

    http://files.cnblogs.com/files/sylar120/fisher_vector.rar 拿各个参数上的偏导作为特征

  6. 博客CSS

    <p style="background: #CFE0F8; padding: 5px;">理解Code First及其约定和配置</p> <p id ...

  7. MySQL_监控用户下单地址没有就近仓库配送情况_20161215

    如果用户所在的地址位于A市场,A市场所就近的仓库应该为a,通过监控发现用户下单后配送仓库的不是a而是b仓库发货,这就会引起物流成本的增加. 因此对客户下单挑选最近的仓库进行监控是很有必要的 #C041 ...

  8. EntityFramework+MySql 笔记2

    话说刚刚配置好环境,刚刚写了几行代码,迫不及待地运行,duang! 踏进了第一个坑 看代码 static void Main(string[] args) { Database.SetInitiali ...

  9. asp.net LINQ实现数据分页

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  10. linq andregex