HTML and CSS connecting

Hi.

I am new in Gethub.

I saw that there are posts about CSS and HTML problemas, but I do not find the answer I am looking for.

I have a web page and CSS is not applied to html. When I made the smaller CSS I applied it. Can you explain the mistake I have? I did the validation of w3c but it says it is correct.

I attach 2 files: HTML and CSS.

Thanks.

make sure u have put your css code in the proper places in the <head> of your document…

You’ve mixed up classes and ids in your css.

E.g. if “navbar” is a class as shown in the HTML, then the CSS should read “.navbar”, not “#navbar”.

4 Likes

Hi. Thanks for your answer, but I applied your recommendations and the css still does not apply to html. The verification of w3c says that the code is correct. Can you help me, please?

I attach html and css new files.

7 <link rel=”stylesheet” type=”text/css” href=”Mystyles.css media=”screen”/>
te sobra la barra que tienes antes de Mystyles.css

8 <link rel=”stylesheet” type=”text/css” href=”Mystyles.css media=”screen”/>
te sobra la barra que tienes antes de Mystyles.css

Gracias, pero antes de Mystyle.css no hay barra, hay comillas. Te refieres a eso?

Por otra parte, si sólo tengo un archivo css que es colores.css debo poner todo ese link diciendo Mystyles.css (lo copié de un tutorial) o es justamente donde debo reemplazar por mi archivo css?

prueba si consigues que funcione, sin la barra, de todos modos, creo que lo que tines que hacer es realizar un enlace con el css original que has de tener puesto en tu ordenador y dentro de la carpeta en la que tienes almacenado el programa, no se bien lo que has hecho, pero es lo que necesitas, a parte de que en css al comienzo de alguna haccion no lleva barras invertidas.

un saludo

Hey @naturaleza106,

Thanks a lot for being here! At this time we don’t have moderators to support a different language than English. I see this thread has been very informative and helpful to all and will ask you to please resume the conversation in English. Thanks again for taking the time to contribute, we look forward to seeing you around!

Best,

Andrea

Hi,

You’ve mixed up classes and ids in your css.
the CSS should read “.navbar”, not “#navbar” and ‘.principal’ ,not "#principal’.

(do not write a class with an  # (hash) but instead write it with an  .  (dot) while writing a class in css