HTML Reference
Attributes
type
Specifies the styling la nguage. If this attribute is absent, then the default CSS (i.e.,
text/css) is assumed.
Example
<style>
body {
color:blue;
}
</style>
<title>
Description Represents the title or nam e of the documen t, w hich is
shown in the browser’s title bar.
Context
May appear in a <head> element that contains no other
<title> elements.
Content
It can only contain text.
C.3 Scripting
<noscript>
Description Defines a portio n of HTML code to be interpreted if script-
ing is unsupported or is currently turned o in the browser.
Content
Code that is to be interpreted if scripting is unsu pported or
turned o.
Display
Inline
Example
<noscript>
<p>If you want to see some mind-blowing stuff, please enable
C.3. Scripting 309
JavaScript in your browser.</p>
</noscript>
<script>
Description Allows authors to include dynamic scripts in their docu-
ments. The scripts may either be embedded inline or im-
ported from an external file by mea ns of th e src attribute.
Content
Without the s rc attribute, content depends on the value of
the type attribute.
With the src attribute, the element should either have no
content or contain script documentation.
Attributes
src
If this attribute is specified, then it gives the name of the external script to be used in
the form of a valid URL. Only one src attribute is p ermitted per element. If the src
attribute is present, no script should be embedded inside the <script> e le ment.
type
This attribute defin es the type of scripting language. If this attribute is absent, then the
default JavaScript (text/javascript) is used.
Examples
<!-- Include code from an external file. -->
<script src="/libs/slideshow.js"></script>
<!-- Include an external file with comments on its usage. -->
<script src="/libs/slideshow.js">
/*
Set the class attribute of <img> elements that you
want to include into a slide show to "slide".
*/
</script>
<!-- Inline code -->
<script>
document.write("Whatever happened to heroes?");
</script>
310 HTML Reference
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.150.119