Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

why add type="" attribute to the link element?

Hello! I just noticed that on one of the links to the stylsheets Nick added a type attribute to it, I was wondering what the purpose of this was, I must have missed that.

Also what is the purpose of the rel="" attribute? I do realize that it shows the relationship, but why is it important or necessary to add that?

1 Answer

Type basically tells you what is the input, basically there are different input types, such as email, so when you write type email, the user needs to include a valid email with @ otherwise it wont work. Do you want password? just type password, and the letters will be blakc dots ( before you had to use JS to do that ) . Text is just normal text etc..

Hopefully this helps!

heck out this link here http://www.w3schools.com/html/html_form_input_types.asp

Hey thanks that does make sense. Now the link that you refer to ist concerning the <input> element, does the same go for the <link> element?

Link is different. Check out this track to learn about it. Do the HTML and CSS basics. You should have 1k points + when finished, and you shoudl know what link is.

In short, link is basically a link which means, if you want to connect or link your CSS to your HTML, to link it, you write link and then the path.

e.g.

 <!-- Core CSS -->
   <link rel="stylesheet" type="text/css" href="css/normalize.css">
   <link rel="stylesheet" href="css/main.css">

   <!-- Fonts -->
   <link rel="stylesheet" href="css/font-awesome.min.css">

I'm liking my CSS to my HTML with the link, and rel, relfering to stylesheets.

type what is that? text a css,,

href? the path to it is in th folder of css and the file name named normalize.css

same goes for the bottom one.