body * {
/* Styling */
position:absolute;
}
body * * {
position:relative;
}
Will this work the way I expect?
I don't know how many sub-elements I'm going to add yet, so I can't really try it, since I'm working on a project, blah blah.
Would this make all elements nested inside of body-nested elements relative
positioned, or does *
work in the way it works as the normal "universal selector", where it can only be overridden by !important
?
Thanks in advance!
Cheers!
Top comments (10)
The end result will be that every immediate child of body will be
position: absolute
, but all elements within will beposition: relative
regardless level of nesting.Demonstrated here with colors:
A * does not have specificity weight so if you reverse the rules then all elements will be red.
Thank you. This was very helpful to my understanding of CSS (because imo, it's kinda wonky).
I like your curious questions, try postCSS!. CSS' days are numbered as more creative thinkers bridge the abstraction gap between 2D/3D layouts, and linear, declarative statements✌🏿
That looks intimidating, what files would I want/need, how would I import them in a meaningful manner?
When it comes to libraries and such (in any language/ctx) I'm an absolute fucking noob, especially when it comes to tools used for web development.
If you’re still learning don’t worry about tooling just yet.
Learn the languages first and when you’re comfortable with them look at things like tooling and frameworks. When you start learning web frameworks like Vue and React you’ll come across the things you need over time.
What if I never become familiar or comfortable with such things?
You don’t learn these things overnight. If you’re willing to learn and grow as a programmer all these things will come with time.
You can learn A LOT of these things on YouTube as well.
Everyone learns different, find what works for you.
If only search engines could find the answers to my very specific questions so I wouldn't have to always ask. I ALWAYS get stuck putting in new keywords, calling my default SE (Google) (and the other ones that fail) a dumbass in the search bar after too much searching.
I hate that SEs aren't so literal w/ keywords/tags.
That’s a skill you develop over time as well. You need to ask your question vague enough to be generally applied, but specific enough as to be useful to you.
Google can be made literal by putting quotes around the keyword.
Give me an example of what you’re trying to find.
How to import java packages that use raw .java files.
It comes up with how to use default packages, and how to make and compile them, but not exactly what I specified.