![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
I've been playing around with some different concepts from different people's codes, and I have... lost my minion somehow XD I know it has something to do with the position, because it would show back up when I switched from absolute to fixed, but now that I've added the sidebar I can't see it no matter what I do. It was also showing up with weird scroll bars when I went to absolute (which is what I want it at) so I figured it was a spacing issue, but no matter how I push it around with the top px settings, it wouldn't show back up (or the stats). Also how do I get the background to stretch across the whole page? I tried telling it 100% but it didn't change.
code by kimokawaii
(art by KayBit on Dappervolk)
What is going on? 1 pet minion: reason you can't see this no matter what is because of the combo of to be "overflow: auto;", the contents are offset and the the container too small to show contents 2 pet stats have been disabled by the code, the container is which is set to display hidden 3 background image seems to cover my screen quite well, but guessing there is white space for your height
Let talk quick fixes:
NOTE: I noticed does not have z-index which will make it be placed behind the element it's over currently. Now on the other hand the contents () does have z-index so its placed in front... the reason I bring this up is the scroll bar is behind while content is in front, just mentioning this observation since Idk if that is your intended result/look
This one is much easier, get rid of "" and " a" then all the information in stats will display again, might want to take the advice from 1 for positioning stats as well
Without knowing more one suggestion that may work is set "background-size: 100% 100%;" this sets both height and width keep in mind this will cause some stretching. Now if the content of the page is bigger than display then there will most likely be white when scrolling, now this can be prevented by adding "background-attachment: fixed;" this stops the background image from scrolling with the rest of the page.
NOTE: In the case of the property background-size when only one value is set, which makes whatever value set the width while height becomes auto.
Hope this is helpful. Also let me know if anything is unclear or need additional help or if you want to know more and when I see your message/ping I'll try rewording or explain anything as best as possible.
===============================================
If needed/desired I put some explanation of some possible values position can be set to
Some position property values explained
Example your profile is absolute its relative to so setting left and top to 0px will place it in the top left corner of the div Now the minion () inside is also absolute but the first ancestor is so position is relative to it, this is what causes the offset I mentioned at the start of post. [spoiler=Quick Ancestor term explanation for html context (just in case)]
I'll use the id to refer to each div. So div 2 is the parent of div 3 and div 1 is the grandparent of div 3 (can have more layers). so div 2 and 1 are considered ancestors to div 3.
Setting position to fixed, position is based on viewport so where ever it's placed it stays there, scrolling doesn't affect it at all.
Setting position to relative, mentioned before but this positions the element is relative to it's normal placement also to keep in mind if there is a gap from moving the element from normal position, other elements won't move to fill in the white space/gap created [/spoiler]
awesome thank you for all of this! I think I have it the way I want it now - decided against including the stats in the end. Quick question: why use a z-index? I don't think I've seen that in other codes I've used. It obviously affects layers, but I had no idea of that even until you pointed that out for me haha
(art by KayBit on Dappervolk)
Okay so let me place this information about z-indexs below:
Now there are a few uses to use z-index so for example your pet's minion needs it otherwise it'd appear behind so it'd not be visible, this is cause minion/coloumn_1 is higher up in the html than the pet_image and such which is in column_2.
Quick additional note: NO need to change this just observation but z-index on is not necessary since the parent () has z-index set (doesn't do any harm either) but knowing more is nice so children will get affected by a parent's z-index.
Fun note: negative values are possible too :)
If you ever need help again please feel free to ping/comment/smail me any questions I'd be happy to help as best as I can. (Also totally fine if you want to add me as a friend)