css - 将样式声明放在正文中是否合法?
问题描述
将样式声明放在 body 标签内是否合法?另一种说法是,如果我需要的话,有什么理由不把它放在身体标签内吗?
前:
<html>
<head>
<style>
#Ellipse_1{stroke:rgb(0,0,0);stroke-width:8px;}
</style>
</head>
<body>
<svg style="position:absolute;width:121px;height:121px;">
<ellipse id="Ellipse_1" rx="60.5" ry="60.5" cx="147.5" cy="164.5">
</svg>
</body>
</html>
后:
<html>
<head>
</head>
<body>
<style>
#Ellipse_1{stroke:rgb(0,0,0);stroke-width:8px;}
</style>
<svg style="position:absolute;width:121px;height:121px;">
<ellipse id="Ellipse_1" rx="60.5" ry="60.5" cx="147.5" cy="164.5">
</svg>
</body>
</html>
解决方案
推荐阅读
- javascript - Webpack 不使用背景图像在浏览器中显示 png 图像
- typeorm - 如何将typeorm的querybuilder的where转换为Repository的FindConditions,就像Sequelize一样?
- mongoose - 从 MongoDB 获取随机用户
- c# - “+”字符导致 IIS URL 重写问题
- flutter - firebase 推送通知将多行添加到有效负载正文
- node.js - 当我尝试获取我的 api 时出现 CORS 错误
- python - 即兴运行时的应用/ lambda
- flutter - 你如何正确地通过在颤振中命名的 push 传递参数?
- android - 在 Flutter 中播放静音视频时如何处理背景音乐?
- javascript - 如何将选定的复选框值插入另一列?