Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<style> and <script> tags are displayed physically on page

Tags:

css

tags

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?

enter image description here

like image 284
user1797770 Avatar asked Aug 12 '13 08:08

user1797770


People also ask

Where do you put the script and style tag in HTML?

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.

Can script tags be in body?

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.

How do I show the script tag in HTML?

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.

Can you put script tags in CSS?

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.


1 Answers

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.

like image 195
Jukka K. Korpela Avatar answered Oct 15 '22 00:10

Jukka K. Korpela