-5

As you can tell I'm very new to coding so please excuse my simple question.

What do the HTML tag attributes rel and type do in the this case?

<link href="css/styles.css" rel="stylesheet" type="text/css">
Dennis Meng
  • 5,109
  • 14
  • 33
  • 36
Timo B.
  • 51
  • 1
  • 1
  • 5

3 Answers3

0

In relation to HTML the rel attribute specifies the relationship between the current document and the linked document it is only used if the href attribute is present.

The style tag will enable you to edit the style e.g color of a particular div, text etc. For example

<html>
<head>
<style>
h1 {color:red;}
p {color:blue;}
</style>
</head>
<body>

<h1>A heading</h1>
<p>A paragraph.</p>

</body>
</html>

This will change the color of the h1 to red and paragraph to blue

The type tag will change the 'type' of something for example

<button type="button">Click Me!</button>

I suggest you check out http://www.w3schools.com/ for some more information

0

rel - to what this element is related. Usually used with some gallery plugins.
type - specify what type of element it is. Used with script/style/input and button elements.

Justinas
  • 41,402
  • 5
  • 66
  • 96
0

Suppose you declared

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

in which The required rel attribute specifies the relationship between the current document and the linked document/resource.

for type attribute

<a href="http://www.google.com" type="text/html">Google</a>

The type attribute specifies the Internet media type (formerly known as MIME type) of the linked document.

This attribute is only used if the href attribute is set.

If type attribute is used with input element then it describe the type of element like as checkbox,input field,radio etc.

Link for more description rel

Link for more description type

Mahesh
  • 1,063
  • 1
  • 12
  • 29