Umbraco website creation (3) reference of CSS and JavaScript

Source: Internet
Author: User
Tags umbraco

In the previous article, we used a template. The style sheets in the template are embedded. Some people may ask how to solve this problem if they are all external style sheets?

This umbraco is also doing well ~! First, we should make the same. Edit the style sheet or Javascript externally,

Then, some of them will be admitted.

For example, this is edited externally.

 

<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">

<Head>
<Meta http-equiv = "content-language" content = "ZH-CN"/>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> heand </title>
<Style>
# Content {
Width: 800px;
Height: 455px;
Background-color: #993333;
}
# Heand {
Height: 136px;
Width: 100%;
Background-color: # 0000ff;
}
# Left {
Height: 250px;
Width: 400px;
Background-color: # ccffcc;
Float: left;
}
# Right {
Height: 250px;
Width: 400px;
Float: right;
Background-color: # ff9966;
}
</Style>
</Head>

<Body>
<Div id = "content">
<Div id = "heand"> heand </div>
<Div id = "Left"> </div>
<Div id = "right"> </div>
</Div>
</Body>

</Html>

 

We first stick the style sheet out.

Open the settings-> stylesheets new key to a style sheet file.

Then paste the style sheet content.

Here, the <style> </style> label is no longer needed ~! Save the settings.

 

Next, open our main template: Put the rest of the content in.

The above sentence is a reference to the style sheet, which is shown in the right div below. My subtemplate content ~!

Save. Preview your page ~! Is it easy?

 

 

Let's talk about the reference of javascript:

The above is the same. Use other tools to write it out first. As follows:

 

<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">

<Head>
<Meta http-equiv = "content-language" content = "ZH-CN"/>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> heand </title>

<Script language = "JavaScript" type = "text/JScript">
Function AA (){
Alert ("hello ");
}
</SCRIPT>

</Head>

<Body onload = "AA ()">
<Div id = "content">
<Div id = "heand"> heand </div>
<Div id = "Left"> </div>
<Div id = "right"> </div>
</Div>
</Body>

</Html>

Next, open the settings-> scripts new key file. Note that

 

Select. JS File

Then we write the JavascriptCodePut it in,

<Script language = "JavaScript" type = "text/JScript"> </SCRIPT> is not required here ~! Save,

Then we reference it in the living template. The Code is as follows:

<SCRIPT src = "/scripts/BB. js" type = "text/JavaScript"> </SCRIPT>

Put it in the

<Body onload = "AA ()">

Call JavaScript;

Save and run our page again:

In this way, JavaScript calls and CSS calls are complete ~!

 

Next, I will introduce the application of XSLT. You are welcome to continue to pay attention to it. Please give us more comments.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.