link元素 rel src href属性

The SRC and HREF attributes are used to include some external entities like an image, a CSS file, a HTML file, any other web page or a JavaScript file.javascript

Is there a clear differentiation between SRC and HREF? Where or when to use SRC or HREF?  I think they can't be used interchangeablycss

  • To refer a CSS file: href="cssfile.css" inside the link tag.
  • To refer a JS file: src="myscript.js" inside the script tag.
  • To refer an image file: src="mypic.jpg" inside an image tag.
  • To refer another webpage: href="http://www.webpage.com" inside an anchor tag.

rel 属性规定当前文档与被连接文档之间的关系。java

只有 rel 属性的 "stylesheet" 值(文档的外部样式表)获得了全部浏览器的支持。其余值只获得了部分地支持。jquery

<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css"/>web

<script type="text/javascript" src="js/jquery.inview.min.js"></script>bootstrap

相关文章