js实现浏览器中移除包含style的html代码中的无用css代码
代码语言:html
所属分类:其他
代码描述:js实现浏览器中移除包含style的html代码中的无用css代码,移除完整html中包含style的css代码没有用到过的css,移除返回dom中会使用的css代码。
代码标签: js 浏览器 移除 包含 style html 代码 无用 css 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>未使用 CSS 移除工具</title>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/tailwindcss.3.4.16.js"></script>
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/all.6.5.1.css">
<style>
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background-color: #f8fafc; }
.toast {
position: fixed;
bottom: 1.25rem;
right: 1.25rem;
padding: 1rem;
border-radius: 0.5rem;
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
color: white;
z-index: 50;
display: flex;
align-items: center;
gap: 0.75rem;
transition: all 0.3s ease;
transform: translateY(200%);
}
.toast.show {
transform: t.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0