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?
The script tag should always be used before the body close or at the bottom in HTML file. The Page will load with HTML and CSS and later JavaScript will load.
The <script> Tag You can place any number of scripts in an HTML document. Scripts can be placed in the <body> , or in the <head> section of an HTML page, or in both.
To add a script, use the <script> tag. The HTML <script> tag is used for declaring a script (such as JavaScript) within your HTML document. Defines the character encoding that the script uses. Declares that the script will not generate any content.
The other night, Amit Patel mentioned that you can set script tags in HTML to display: block with CSS and then edit that code inline with the contentEditable attribute. This means that you can then see it all update live in the browser as you type.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With