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
href="cssfile.css"
inside the link tag.src="myscript.js"
inside the script tag.src="mypic.jpg"
inside an image tag.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