头部icon写法
<link rel="shortcut icon" href="图片url">
http转https
网页中的链接需要都转为https请求,并且数据是动态的情况处理方式
<!--指定该网页中http转https访问-->
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
a标签打开方式
// 语法
<a target="_blank"></a>
可选值:
_blank
:新窗口打开_self
:在相同的框架中打开,默认_parent
:父框架中打开_top
:在整个窗口中打开framename
:在指定的框架中打开
textarea禁止拖拽
<textarea style="resize:none;"></textarea>
文字禁止选中
<div onselectstart="return false">
</div>
css方式
/* 禁止选中 */
user-select: none;
关闭输入框红色波浪线
<textarea spellcheck="false"></textarea>
对contenteditable
属性同样有效
svg的引入方式
<p><img src="/lib/svg/wechat-fill.svg" alt=""></p>
<p><object id="object" data="/lib/svg/wechat-fill.svg" type="image/svg+xml"></object></p>
<p><embed id="embed" src="/lib/svg/wechat-fill.svg" type="image/svg+xml"></p>
svg颜色跟随父容器调节
关键代码:fill="currentColor"
<svg t="1661761707943" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
p-id="12758" width="16" height="16">
<path d="M101.188 406.2l248.169 184.115 266.799-181.721-178.15 270.229L624.188 929.2l304.7-828.5z"
p-id="12759" fill="currentColor"></path>
</svg>