Home > Software design >  html file does not link to an external css file but when I write inline styling it works
html file does not link to an external css file but when I write inline styling it works

Time:07-11

<!DOCTYPE html>
<html>
 <head>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="copyright" content="Clint's name">
    <meta name="author" content="Eyad Mohamed">
    <meta name="description" content="Website description">
    <title>Clint's name</title>
    <link rel="stylesheet" href="Testing.css">
    
 </head>

 <body>
    <div>
     <img src="D:\my every thing\Projects\Projects\Programming.code-workspace\Elephant Logo.png">
    </div>
 </body>
</html>

I want to link an external css file but it not making any change even when I resize the image and center it but when I write inline style attribute it works so I don't know what is happening

CodePudding user response:

Try this

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

Provide Correct Location of css

CodePudding user response:

There could be many reason why you can’t operate on the css file. First I’d try to check if the original file is spelled correctly and making sure that the extension ( .css ) is lowercase. But if that isn’t the issue I would make sure the file is located on the same directory as the html file, basically ensuring that the path matches.

  • Related