We are working on our Node.js based Chat.
And have a lil CSS issue again. To see it go to the sample chat, which is here:
and you will see the DIV that is to state the Room value, which in this sample case says:
“Anoox Public Test Chat Room”
in the DIV ID = owner_area
is getting buried under something!
So we want to move this DIV with position: absolute; via top negative value outside of the DIV which
contains it as a relative DIV.
We have even given it z-index of 1500 or whatever value but when we move it out of the DIV it becomes buried!
How do we make the DIV ID = owner_area to be visible while outside the relative DIV that contains it?
So to be clear we want this DIV ID = owner_area to be relative to DIV ID = chat_con so that in devices with different screen sizes, Mobile phone, etc. we have certain positioning between these 2 DIVs.
The problem is that you have used overflow:auto and position:relative on #chat_con which means that an absolute element cannot escape from an overflow box when the parent has position:relative applied.
If you remove position:relative from #chat_con and then use top:auto on #owner_area you can then nudge it into place with negative margins.
e.g.
#chat_con{position:static}/* was relative*/
#owner_area{
top:auto;/* was top:-10px*/
margin:-1.4em 0 0 1em
}
Generally it’s the coder that is the doozy ( no offence intended)
If you tell the element to control the overflow so it doesn’t spill out (overflow auto) then how do you expect to easily move content outside of that area? You just told it not to do that
There is logic to CSS and there are stil ways to do most things but as mentiomed before you have to learn the rules of the language first ( as with all languages).
CSS isn’t perfect and does have unintuitive parts but there is an undeniable logic to most of its rules. Newbies often fall foul due to lack of knowledge or poor coding techniques ( like your header that obscures your content when it wraps at smaller widths).
At the end of the day CSS does mostly what it was designed to do - it’s up to the coder to use it properly.
I’m not saying CSS couldn’t be better in places but its not as bad as you make out