HTML Introduction to HTML and CSS Adding a New Web Page Write the CSS

alexandre Barrantes
alexandre Barrantes
1,986 Points

what is wrong with my codes? My webpage looks wrong now...

<!doctype html> <html> <head> <title> Alexandre Barrantes's resume </title> <link rel="stylesheet" href="resume.css">

</head> <body> <img src="https://placeimg.com/200/200/tech" alt="Alexandre Barrantes, Web Developer" class="main-image"> <h1> Alexandre Barrantes, Web Developer</h1> <h2> Summary of Qualifications</h2> <ul> <li> Experience as a Freelancer Web Developer </li> <li> Experience as a Sales Representative at Fido Canada</li> <li> Bachelor in Cumputer Science</li> </ul> </body>

</html>

Are you asking why your code from your style sheet isn't applying to your html file? If so, you should probably start by looking at the 'href="resume.css"' attribute in the link element.

Martha Brown
Martha Brown
4,380 Points

Here is an example for linking a CSS stylesheet to your HTML index root file: <link rel="stylesheet" type="text/css" href="theme.css">

Also, this website might be helpful to you. https://itstillworks.com/create-index-file-7285723.html

Incidentally, check how computer is spelled. : )

5 Answers

Jacek Bialek
Jacek Bialek
11,566 Points

1.........................................................................save it as index.html....................................................................

<!doctype html> <html> <head> <title> Alexandre Barrantes's resume </title> <link rel="stylesheet" href="resume.css"> </head> <body> <img src="https://placeimg.com/200/200/tech" alt="Alexandre Barrantes, Web Developer" class="main-image"> <h1> Alexandre Barrantes, Web Developer</h1> <h2> Summary of Qualifications</h2> <ul> <li> Experience as a Freelancer Web Developer </li> <li> Experience as a Sales Representative at Fido Canada</li> <li> Bachelor in Cumputer Science</li> </ul> </body> </html>

2.............................................................save your .css file in the same folder................................................

3.................................................................................it should work...............................................................................

Jacek Bialek
Jacek Bialek
11,566 Points

Be sure file "resume.css" is in the same folder in which your "index.html" is located.

Sabrina Hoeke
Sabrina Hoeke
11,799 Points

As jacek was saying. You have a path that says your resume.css file is in the same folder as index.html. If it's not, and say you have it in a folder call css (which is what I usually do) then the path would need to be "css/resume.css". It must be relative to where your index.html file is.

alexandre Barrantes
alexandre Barrantes
1,986 Points

i dont understand when you say that my resume.css is in the same folder as index.html. I dont see the index.htlm. What should i add or erase?

thanks for your help

Ruan Davis
Ruan Davis
7,343 Points

Always remember that your path towards your css should be accurately defined. If you need to step into a folder use the folder name / file name.css.

If your css was located in a sub folder your path from your root directory would be/folder name /sub folder name/ file name.

Sabrina Hoeke
Sabrina Hoeke
11,799 Points

We are referring to the html file that you are writing in and linking your css sheet to. It is usually saved as "index.html" but you may have named yours something else. That file needs to be at the root of your directory, so not inside another folder. For example, if I create a folder for my webpage, I might create a folder named "myWebpage". If I open that I would see a file which I created and named "index.html". I would have also created a folder called "css" and inside that folder I would create a file named "style.css". That is the css file I would write my main styles in for the index.html file. It would need a link in "index.html" with the path "css/style.css".