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.

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

  • 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 属性规定当前文档与被链接文档之间的关系。

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

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

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

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值