I'm having trouble with applying CSS to my HTML

对着背影说爱祢 提交于 2020-01-16 08:43:28

问题


I've tried inline CSS and also then changed to linking an external stylesheet but neither will load for me in any browser when I test the code. Could it be that I haven't saved my css file properly? How may I do that?

With the external stylesheet (my ideal option for the website) -

<!doctype html>
<html lang="en">

<head>
    <title>My name Homepage</title>
    <link rel="stylesheet" type="text/css" href="styles/main.css">
</head>

<body>
    <h1> This is My Name</h1>
    <h2>Welcome to my website.</h2>
    <p> Age</p>
    <p>Likes/Dislikes</p>
    <p>Career</p>
    <ul>
        <li>Home</li>
        <li><a href="About.html">About</a></li>
        <li><a href="Artportfolio.html">Art Portfolio</a></li>
    </ul>
</body>

</html>

My current CSS (all I have so far since I just wanted to test) -

body{
    background: #000000;
}

来源:https://stackoverflow.com/questions/58827762/im-having-trouble-with-applying-css-to-my-html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!