Skip to content Skip to sidebar Skip to footer

Differences Between 'url', 'src', And 'href'

Possible Duplicate: Difference between SRC and HREF When writing html/css, it seems like these all do the exact same thing. Obviously this is not the case, and if you 'href' whe

Solution 1:

src -- I want to load up this resource for myself.

href -- I want to refer to this resource for someone else.

url -- A script wants to use this url as a variable.

Solution 2:

  1. In CSS, it's always url.
  2. In HTML:
    1. It's href (short for Hypertext REFerence) for all kinds of links, including tags a and link.
    2. When it's not a link, you are setting the source, so it's src.

Solution 3:

it's very simple

you can use href for links as follows: <a href="http://www.google.com/">Click here</a><link href="mystylesheet.css" type="text/css">

Now use to src put the links into html like this: <img src="mypic.jpg"><script src="script.js"></script>

Post a Comment for "Differences Between 'url', 'src', And 'href'"