DEV Community

Cover image for “href” vs. “src” in HTML

“href” vs. “src” in HTML

Sung M. Kim on July 18, 2019

Last night, I vented out my frustration on <link> requiring href to point to a CSS stylesheet instead of src. I will share the help I receiv...
Collapse
 
karataev profile image
Eugene Karataev • Edited

css

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀 • Edited

I wish.

I wish html import was still a thing as well.

Collapse
 
somedood profile image
Basti Ortiz

Why is this not a thing yet??? 🤦‍♂️🤦‍♂️🤦‍♂️

Collapse
 
vuild profile image
Vuild

There are a lot of other head elements that follow <link rel= like pingback & profile etc.

I prefer not to have "style src" as well.

Thread Thread
 
somedood profile image
Basti Ortiz

Yeah, I suppose you're correct there. It does seem to be consistent with the convention of <head> elements. I guess it's not entirely as inconsistent as I first thought it was.

Thread Thread
 
vuild profile image
Vuild

Yeah, it seems elegant at first glance but would be more error prone.

I'd suggest removing type='text/css' but I know there will be a specific reason to keep it.

Collapse
 
vuild profile image
Vuild

Yw. You should probably try Brendan's browser Brave:
brave.com
creators.brave.com & verify your site, get paid in BAT crypto.
batgrowth.com growing nicely.

& Håkon's (imagine being called Hak while you hack CSS together) Opera
opera.com

👍

Collapse
 
dance2die profile image
Sung M. Kim

Wow. Brave is another product/project spearheaded by Brendan.
I wasn't aware until you brought it up.

Thanks~

Collapse
 
vuild profile image
Vuild
  • Creator of JS
  • Mozilla/Firefox
  • Brave/BAT

Insane.

And willing to come along to give good advice to help people, small ego. One of the few people I have to read multiple times, do research to understand.

If I ask him for advice I try to always promote Brave too as it is good browser & seems like a nice way to pay back a little. I figure if we are promoting Brave, he can be giving out advice. Seems wise use of time to me.

Thread Thread
 
dance2die profile image
Sung M. Kim

Agreed on points described.

So just installed Brave & turned on the Reward settings :)

Thread Thread
 
vuild profile image
Vuild

Nice, they give rewards for browsing, others can pay your site for reading & you can tip. 👍

Checkout brave.com/about/ most are on twitter or somewhere.

Thread Thread
 
dance2die profile image
Sung M. Kim

Thanks for the follow-up info 👊

Collapse
 
chantastic profile image
chantastic

nice right write up!
I've always wondered this and never had the audacity to ask.
thanks for taking the time and care to chase it down!

Collapse
 
dance2die profile image
Sung M. Kim

Thank you for the kind words, Michael 😃

And I also gotta thank @vuild for starting up the "chase" 😉

Collapse
 
vuild profile image
Vuild

I appreciate the sentiment but there is no need, really.

The history should be recorded, studied & revisited by tech people.

Collapse
 
ben profile image
Ben Halpern

I just learned so much

Collapse
 
calebpitan profile image
Caleb Adepitan

Me too! I mean who hasn't "learned so much"

Collapse
 
dance2die profile image
Sung M. Kim

Thanks for the "so much" instead of "too much" 😉

Collapse
 
phillipseamore profile image
phillipseamore

Since linked stylesheets can be conditionally loaded (media queries) I think HREF might just be very approiate.

Collapse
 
dance2die profile image
Sung M. Kim

That's an interesting approach.
I can use that thought pattern to remember the syntax 😀

Collapse
 
kleene1 profile image
kleene1

Cool lol

Collapse
 
prelias profile image
Paulo Roberto Elias

Very nice article. Thanks and congratulations

Collapse
 
fly profile image
joon

Fantastic read

Collapse
 
dance2die profile image
Sung M. Kim

Thanks again Joon :)