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>

link元素 rel src href属性的更多相关文章

  1. link @import区别 src href的区别

    先说页面引入css的四种方式吧 1 在头部写在style里面 2 行内样式 tyle= 3 外部引入 link和@import的区别 link属于XHTML的标签,而@import只是css提供的一种 ...

  2. 利用link标签rel="alternate stylesheet"属性实现界面动态换肤

    rel="stylesheet"属性指定将一个样式表立即应用到文档.rel="alternate stylesheet"属性将其作为备用样式表而在默认情况下禁用 ...

  3. 可否控制<link type=text/css rel=stylesheet href=style.css>

    本篇文章主要介绍了"可否控制<link type=text/css rel=stylesheet href=style.css> ", 主要涉及到可否控制<lin ...

  4. 【27前端】base标签带有href属性会让chrome里的svg元素url失效

    一个chrome的问题,但具体原因不明. 触发条件:chrome浏览器base标签里href属性有值的时候 触发问题:svg里面的元素如果有用url的滤镜和模糊,则会失效,在firefox里和IE10 ...

  5. <link rel="stylesheet" href="3.css"/> 链接方式

    <link rel="stylesheet" href="3.css"/> <!doctype html> <html> & ...

  6. wordpress去掉<link rel='dns-prefetch' href='//s.w.org' />

    我们在用wordpress建站时经常会看到<link rel='dns-prefetch' href='//s.w.org' />,应该是为了从s.w.org预获取表情和头像,目的是提高网 ...

  7. JQUERY 提取多个元素 a img 的 src href

    <div class="abc"><a href="1.html"><img src="1.jpg"/> ...

  8. HTML元素 绑定href属性

    给<li>标签绑定href属性 <ul class="honor-list clearfix"> <li style="cursor:poi ...

  9. JS魔法堂:LINK元素深入详解

    一.前言 我们一般使用方式为 <link type="text/css" rel="stylesheet" href="text.css&quo ...

随机推荐

  1. 【转】Java基础:System.out.println与System.err.println的区别

    同时使用了System.out.println与System.err.println()打印输入内容,结果看到的内容和预想的不一样,顺序与预料的不同并不是因为err和out的区别导致,而是因为他们是两 ...

  2. python 可迭代对象

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. 可以用for 进行迭代的,一般都是可迭代对象: ...

  3. 【springboot】【redis】springboot+redis实现发布订阅功能,实现redis的消息队列的功能

    springboot+redis实现发布订阅功能,实现redis的消息队列的功能 参考:https://www.cnblogs.com/cx987514451/p/9529611.html 思考一个问 ...

  4. Sublime Text 显示韩文和文件编码

    菜单  Preferences –> Settings 右侧的User {    "font_size": 12,    "show_encoding": ...

  5. Android的Databinding-资源绑定

    databinding还能对布局的资源文件进行绑定. <data class="ResourceBinding"> <variable name="la ...

  6. 【Spring】bean动态注册到spring

    /* * http://412887952-qq-com.iteye.com/blog/2348445 * http://www.jb51.net/article/106558.htm * https ...

  7. [Python设计模式] 第25章 联合国维护世界和平——中介者模式

    github地址:https://github.com/cheesezh/python_design_patterns 题目背景 联合国在世界上就是中介者的角色,各国之间的关系复杂,类似不同的对象和对 ...

  8. gdb调试常用实用命令和core dump文件的生成(转)

    1.生成core dump文件的方法: $  ulimit -c //查看是否为0 如果为0 $   ulimit -c unlimited 这样在程序崩溃以后会在当前目录生成一个core.xxxx的 ...

  9. Eslint 规则说明

    "no-alert": 0,//禁止使用alert confirm prompt"no-array-constructor": 2,//禁止使用数组构造器&qu ...

  10. BTARN 接收消息流以3A7为例

     1.RNIFReceive.aspx 页接收来自发起方的传入消息. (如果发起方是BizTalk则类似于:http://localhost/BTARNApp/RNIFSend.aspx?TPUrl ...