I have a div with this CSS
#container {
position: absolute;
left: 360px;
top: 100px;
width:640px;
overflow: hidden;
}
If the window's width is less than 1000 (360 + 640px) and greater than
360px how do I get the width of the div to change so it doesn't exceed
the window width?
To add a wrinkle, the div will be draggable so I'd like the div to be
able to grow to it's intrinsic width, if there' space for it.
Andrew Poulos
In article ap_prog@hotmail.com says...
I have a div with this CSS
#container {
position: absolute;
left: 360px;
top: 100px;
width:640px;
overflow: hidden;
}
If the window's width is less than 1000 (360 + 640px) and greater than
360px how do I get the width of the div to change so it doesn't exceed
the window width?
To add a wrinkle, the div will be draggable so I'd like the div to be
able to grow to it's intrinsic width, if there' space for it.
Andrew Poulos
Would this be a good place to use CSS variables and the Calc function?
Watch out for scrollbars, though.
Philip Herlihy <thiswillbounceback@you.com> wrote on 25 Oct 2020 in comp.infosystems.www.authoring.stylesheets:
In article ap_prog@hotmail.com says...
I have a div with this CSS
#container {
position: absolute;
left: 360px;
top: 100px;
width:640px;
overflow: hidden;
}
If the window's width is less than 1000 (360 + 640px) and greater than
360px how do I get the width of the div to change so it doesn't exceed
the window width?
To add a wrinkle, the div will be draggable so I'd like the div to be
able to grow to it's intrinsic width, if there' space for it.
Andrew Poulos
Would this be a good place to use CSS variables and the Calc function?
Watch out for scrollbars, though.
Don't use absolute dimensions in variable viewports,
try:
vw
1% of the viewport's width.
vh
1% of the viewport's height.
vmin
1% of the viewport's smaller dimension.
vmax
1% of the viewport's larger dimension.
Don't use absolute dimensions in variable viewports,
try:
vw
1% of the viewport's width.
vh
1% of the viewport's height.
vmin
1% of the viewport's smaller dimension.
vmax
1% of the viewport's larger dimension.
Ok, what I'll do is then to use relative dimensions but also allow the element to be user resizable.
Andrew Poulos <ap_prog@hotmail.com> wrote on 26 Oct 2020 in comp.infosystems.www.authoring.stylesheets:
Don't use absolute dimensions in variable viewports,
try:
vw
1% of the viewport's width.
vh
1% of the viewport's height.
vmin
1% of the viewport's smaller dimension.
vmax
1% of the viewport's larger dimension.
Ok, what I'll do is then to use relative dimensions but also allow the
element to be user resizable.
The latter has nothing to do with your problem, I presume.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 78:16:31 |
Calls: | 6,658 |
Calls today: | 4 |
Files: | 12,203 |
Messages: | 5,332,972 |
Posted today: | 1 |