Help > Layout & Coding Help > Post Reply
Class Order & Hierarchy, etc.
Eyre ‣ long live the pioneers June 7th, 2022 8:45:53pm 10,120 Posts |
Hello! Eyre has never understood html class, child, parent orders and hierarchys: so 1) is there a good website that might explain these relationships and 2) how to all these elements work together with HP layout codes? From my understanding, and my current layout tweaks and fiddles, HP's player info influences my name divider which influences my scroll box placements, which further influences the layout tag's height element which may or may not influence the even flow of the rest of the page flow... I'm trying to stack the two scroll boxes on top of each other, as well. And what is the purpose of a width and height for the "player info" element, aside from putting the msg/buddy/block on one line or another? Vague descriptions, I know, but some clarity would be helpful, if any direction or aid can be sought. I wouldn't mind a direct fix, but I am also interested in learning the "why" for my understanding, too. Thank you, muchly, in advance. (am subscribed to thread so feel free to reply direct or msg me indirectly) |
View Comments 1
mango 🍑 stay your pretty eyes on course June 7th, 2022 9:51:07pm 2,926 Posts |
Ok so I'm gonna start you off with w3schools, which is where everyone learns to code from. They're the defining source of web dev info, and the go-to for learning to code. This is the tutorial page for HTML elements that starts to go into parent/child relationships. I would highly recommend following the tutorial from there as it has a lot of info and interactive examples to help you understand how these elements relate to each other :D |
↬ JADE 🖤 shake those stars from your hair, pretty moonchild June 8th, 2022 12:29:45am 3,847 Posts |
Something I highly recommend learning more about is the position selector for CSS. You can find more information about this here: https://css-tricks.com/absolute-relative-fixed-positioining-how-do-they-differ/ Even if you specify where they should be using top, bottom, left, or right CSS selectors, you need to remember that they will still take into account where they originally began and their "home" will remain a factor for any DIV that comes after them. So if DIV1's height is 200px, DIV2 will need to be moved at least 200 pixels up (using TOP:-200px; in the CSS) in order to be on the same x axis as DIV1. If you're trying to put two scrolls side by side, you will want the second scroll to be moved up the height of the first scroll then move it to the right or left by the width of the first scroll to have it sit beside the first scroll without them overlapping. In the above example, I've moved paper3 up the same amount I moved paper2. Because they were moved the same amount up, they are now touching the same way they were if they were in their original positions. If I moved paper3 up the full height of paper2, they would overlap like paper2 overlaps paper1. If I wanted paper3 to be on the same x axis as paper1, I would have to move it up the combined height of both paper2 and paper3. Again, paper4 doesn't move because paper3's "home" is still remembered. The advantage of using relative is that everything in your layout will fit cleanly in a line and if you resize the window things will usually stay exactly where they should. The disadvantage of using relative is that if you have five or more elements in your layout, you may have to manually move every element individually over and over again to get things positioned exactly where you want them to be. If you end up moving element 3 later because you decide you want it somewhere else, you will have to go back and manually adjust elements 4 and 5 as well because their position will move after you move element 3. This is where some of the other positioning types that I linked at the top of my post can come in handy. The upside for absolute positioning is that it moves that element individually from all of the others, but the downside can be that it is harder to position initially and it can sometimes float or move where you don't want it to if you resize the window (aka if someone with a different size screen views the layout things may not appear where you intended for them to appear). It takes a lot of fiddling to figure out the best positioning elements for the layout you are trying to create and coding in HP can at times behave a bit funkier than if you were coding on your own site or coding website such as codepen.io. This is because HP has a lot of its own base coding that interferes with how your coding will appear or behave. This was a bit longer than I intended it to be, but I hope it helps a little bit with understanding how DIVs take up space and react to each other! ♥ |
Eyre ‣ long live the pioneers June 10th, 2022 1:09:20am 10,120 Posts |
Okay, um, wow! This actually makes so much more sense than I thought it would! Where were you guys for all my wimpy website layout endeavors?!? If my professors taught like this I would be totally fine in my digital design pursuits! HUGE thank yous!! |
Eyre ‣ long live the pioneers June 10th, 2022 2:44:13pm 10,120 Posts |
w3schools hasn't really made sense to me in the past....Another question: when inspecting a page in developer tools from your browser settings, is there a way to interpret where the parents and their children's childrens are in order to understand your coding tweaks versus the website's default coding interpretation? It helps me to have the big picture AND the immediate picture. Codepen makes it difficult for me to see both, at times. |
↬ JADE 🖤 shake those stars from your hair, pretty moonchild June 10th, 2022 10:03:29pm 3,847 Posts |
I hardly ever use the inspect tool for that kind of job. Your best bet is to use the "view page source" option instead. This will allow you to see the entire page coding in the order it's actually being read in and see where your coding is inserted in the site coding. |
Coeur de Pirate {bavarian warmbloods} June 10th, 2022 11:14:57pm 111 Posts |
No, you are completely right! Hand to heart that I do not wish to "steal" codes in such a manner, myself. Ultimately, I would implore someone to let me know if I stole a code from them, even if I didn't mean to do so. Even if you didn't mean to steal a certain aspect of one's code, you didn't ask permission or compensate the code creator in any way or right, so, yeah, it is technically stealing/copy and pasting. I try to learn from ctrl u, but can't help but wonder if the random highlights that pop up in developer tools could aid me in real time, as well. Might have to do a bit more digging myself in that regard. |
↬ JADE 🖤 shake those stars from your hair, pretty moonchild June 10th, 2022 11:21:51pm 3,847 Posts |
Like I said, a general note to anyone who may stalk this thread now or in the future that perhaps didn't know about page source. I promise I'm not calling you out whatsoever! ♥ |
View Comments 1