Latest solutions
Four Card Feature Section | ReactJs, SSG with vite, TailwindCSS
#react#vite#tailwind-cssSubmitted over 2 years agoRest Countries App | ReactJs, React-Router, CSS module
#react#react-router#viteSubmitted over 2 years agoMulti Step Form | ReactJs, useContext, React-Router, TailwindCss
#react#react-router#tailwind-css#viteSubmitted over 2 years agoInteractive Rating Component | Typescript, ReactJs, Tailwind, Vite
#react#typescript#vite#accessibilitySubmitted over 2 years ago
Latest comments
- @shinaeli@Strocs
Hi @shinaeli, I was looking on your code and found your problem.
previousElementSibling is working just fine, your problem is with css selectors specificity:
Change class selector + type selector (.compo h3) to a type selector (h3), this is because a class + type selector will have high priority over just a type selector, or class selector. (this is not the best solution, always is better use a class selector for every element)
h3 { padding: 5px; background-color: hsl(25, 47%, 15%); color: #fff; font-size: 12px; border-radius: 2px; margin-bottom: 5px; text-align: center; display: none; }
This is a great article for learn css selector specificity: Importance of CSS Specificity and its best practices
Hope this helps you! have a nice code day 😀
- @mmiskiewicz99@Strocs
Hello Marcin, Great Solution! gratz!
I was looking at your code and this is your problem:
body{ background-image: url(../images/pattern-background-mobile.svg); }
that means your link path is looking one folder up, try this:
body{ background-image: url(./images/pattern-background-mobile.svg); }
./ :- This delimiter points to the parent folder of the current working file. It gives access to all the files and folders in the parent folder of the current working file. Let us look at another project structure.
../ : This delimiter points one folder up the parent directory/folder of the current working file i.e it points to the parent folder of the parent folder of the current working file. More like to the grand parent folder.
Source: Understanding File Paths
Hope will be useful, Cheers!