< style>和< script>标签在页面上物理显示 [英] <style> and <script> tags are displayed physically on page
问题描述
我有非常奇怪的问题。如果我把页面上的样式或脚本标签,浏览器将它们视为html元素。换句话说,它们被显示,在物理上打印在页面上。底部代码显示在浏览器中,页面上,当我开始我的项目。有任何建议吗?
i have very weird problem. If i put style or script tag on page, the browser sees them as html elements. In other words they are displayed, printed on page physically. Bottom code is shown in browser, on page, when i start my project. Any suggestions?
推荐答案
在你的CSS代码中,你可能设置 display:inline-block
head
, style
和脚本
使用通用选择器 *
。默认情况下,这些元素不显示(它们暗示 display:none
),但在许多浏览器上,这可以用CSS更改。它通常没有用,但可能。
In your CSS code, you probably set display: inline-block
on head
, style
, and script
elements, possibly due to the use of the universal selector *
. By default, those elements are not displayed (they have implied display: none
), but on many browsers, this can be changed with CSS. It’s normally not useful, but possible.
这篇关于< style>和< script>标签在页面上物理显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!