0
css link
when playing around with a code that has both html and css i was changing the color of the font with css. i got the color to change with link rel="stylesheet" and with link href="example.css" should i have both? is there a difference? and what is their relation to one another?
4 Réponses
+ 5
please show your code.
did you do something like this:
<link rel="stylesheet">
<link href="example.css">
+ 3
the second code won't use your stylesheet, because you didn't tell which one. that's what href is for.
use the example Raj Kumar Chauhan provided.
+ 1
<link rel="stylesheet" href="example.css">
if you are using HTML5, then you can drop rel attribute else use both.
it should work fine.
0
<html>
<head>
<link href="eample.css">
<title>Page Title</title>
</head>
<h2>hello</h2>
<body>
</body>
</html>
but this also works
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet">
<title>Page Title</title>
</head>
<h2>hello</h2>
<body>
</body>
</html>