Different JavaScript and CSS image paths

Source: Internet
Author: User

A Javascript script and CSS file will be referenced in an HTML page. During HTML display, the mechanisms for referencing these two files are different.

For JS scripts, HTML loads the scripts to the page for parsing, similar to the <@! Include>.

CSS is not loaded into HTML. It is just a link. HTML uses the link to find the desired class in CSS.

For this analysis, we can see that the two file formats are referenced:

<! -- CSS is link, link -->

<Link href = ".../../public/Second/styles/tab.css" type = "text/CSS" rel = "stylesheet"/>

<! -- JS is loaded, and the JS format is the same as that written directly on the page -->
<SCRIPT type = "text/JavaScript" src = ".../public/scripts/JB/calendar. js"> </SCRIPT>

 

This difference is especially important when there are images in JS and CSS. Many people cannot see the images. This is where they are wrong.

If there are images in JS, refer to the HTML path of the referenced image, and there are images in CSS. The path is subject to this document.

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.