HTML and CSS connecting #21367
-
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. |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments
-
make sure u have put your css code in the proper places in the <head> of your document… |
Beta Was this translation helpful? Give feedback.
-
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”. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
7 <link rel=”stylesheet” type=”text/css” href=”Mystyles.css media=”screen”/> |
Beta Was this translation helpful? Give feedback.
-
8 <link rel=”stylesheet” type=”text/css” href=”Mystyles.css media=”screen”/> |
Beta Was this translation helpful? Give feedback.
-
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? |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
Hi, You’ve mixed up classes and ids in your css. |
Beta Was this translation helpful? Give feedback.
-
(do not write a class with an # (hash) but instead write it with an . (dot) while writing a class in css |
Beta Was this translation helpful? Give feedback.
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”.