HTML with CSS / it doesn't work

Hello guys,

I’m trying to make CSS code for my cv.
In my HTML code I put :

<head>
link rel="stylesheet" type="text/css" href="style-cv.css"
</head>

When I make changes on my CSS code it doesn’t work on my HTMLcode.

I don’t understand what’s wrong with my code.

For exemple I need to change de the color of one of Li.

in HTML i put:

< li class="pink">

in css I put:

.pink

{color: green}

it doesn’t work…

Thank you in advance for your help.

1 Like

Please format your code as follow:

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

1 Like
link rel="stylesheet" type="text/css" href="style-cv.css"

I think it should be : < link … . . .

1 Like

@ilenia Thank you very much. I just corrected it.

Still doesn’t work.

Thank you @emoclasic
I use “Sublime text” to code…

how’s your folder structure?

@ieahleen

@ilenia

you need to write the correct path, so how are the files in the folders? are they in the same folder?

1 Like

hello! here is the link which may help https://www.w3schools.com/html/html_filepaths.asp

1 Like

You could try to put these 2 files into a folder on the Desktop or anywhere and use
href="./style-cv.css" instead of href=“style-cv.css”.
(And change the .html file’s name to lowercase; but it’s not a big problem :slight_smile: )

3 Likes

Still doesn’t work

@Loussine
I don’t see semicolon here.


.pink {
color: green; //semicolon
}
2 Likes

Wait a minute!! Do you have a “style.css” text on your first line in your style-cv.css? Why is it there? :smiley:

2 Likes

@ennlacc

Thank you for your reply.
At the moment that’s all I have in mi CSS code. I think I have a problem to connect my HTML code with CSS…

And this is my HTML code

@Loussine
There is a mistake in linking the CSS file.
like you gave the href="style.css" but your CSS file name is “style-cv”
you should change the code into href="style-cv.css"

Thanks,
Happy Coding !

Thank you.

Still doesn’t’ work:

Why there is a text on top of the CSS file like style.css ?

2 Likes

OMG,

it worked…
Thank you !!!

Absolutely, I don’t know why I wrote this text there, that’s why it didn’t work…

Thank you !!! @codely

2 Likes