rcss position: absolute; top: 0; bottom: 0;

Discussion of features and help with problems encountered while using libRocket

rcss position: absolute; top: 0; bottom: 0;

Postby krush on Tue Mar 10, 2015 11:02 pm

I'm trying to use absolute position to make a <div> fill the full area. Namely I want to create a <div> above a <input type='text'> to create a console.

The problem:

librocket doesn't use BOTH top/bottom at the same time or left/right at the same time. It just uses whichever it finds first. Is there a workaround for this?

Should be noted I'm using the version of librocket that's integrated into Panda3d.

Code: Select all
<rml>
<head></head>
<body>
   <div id="console" style="position: absolute; top: 0; bottom: 25;"></div>
   <input id="input" type="text" style="position: absolute; bottom: 0; height: 20px;"></input>
</body>
</rml>
krush
 
Posts: 5
Joined: Tue Mar 10, 2015 10:55 pm

Re: rcss position: absolute; top: 0; bottom: 0;

Postby AFineTapestry on Fri Mar 20, 2015 1:47 pm

Hi,

Edit: This won't work I don't think.

You probably want:
Code: Select all
<rml>
<head></head>
<body>
   <div id="console" style="position: absolute; bottom: 20px; height: 100%;"></div>
   <input id="input" type="text" style="position: absolute; bottom: 0; height: 20px;"></input>
</body>
</rml>


Cheers,
AFT
AFineTapestry
Rocket Engineer
Rocket Engineer
 
Posts: 11
Joined: Fri Jun 13, 2014 8:55 am

Re: rcss position: absolute; top: 0; bottom: 0;

Postby krush on Fri Mar 20, 2015 7:00 pm

AFineTapestry wrote:Hi,

Edit: This won't work I don't think.

You probably want:
Code: Select all
<rml>
<head></head>
<body>
   <div id="console" style="position: absolute; bottom: 20px; height: 100%;"></div>
   <input id="input" type="text" style="position: absolute; bottom: 0; height: 20px;"></input>
</body>
</rml>


Cheers,
AFT


Yeah that doesn't work, it still results in the top of the 'console' going off-screen, as it's being given the height of the whole document, not the remaining.
krush
 
Posts: 5
Joined: Tue Mar 10, 2015 10:55 pm

Re: rcss position: absolute; top: 0; bottom: 0;

Postby krush on Mon Aug 17, 2015 7:20 pm

Combinging left: 0; and right: 0; doesn't work either for using to fill a container.
krush
 
Posts: 5
Joined: Tue Mar 10, 2015 10:55 pm


Return to Using libRocket