An element (div) enclosed by "border"
An element (div) enclosed by "border"
(OP)
Hi everyone,
My "container" div contains various changeable elements such as lists, forms and more within it.
That "container" has a "border" property to confine it's content by a surrounding frame.
I wouldn't like this "frame" to be static, meaning: it shouldn't have a rigid width such as: "100px".
I want its' width to change in accordance with its' content. If the content of that div is 10 px, border's
width should be 10 px etc..
I tried: "width: auto; margin: auto" and recieved the whole display's width as border's width.
Can anyone give me a suggestion of how to create an "elastic" border attribute?
Thanks
My "container" div contains various changeable elements such as lists, forms and more within it.
That "container" has a "border" property to confine it's content by a surrounding frame.
I wouldn't like this "frame" to be static, meaning: it shouldn't have a rigid width such as: "100px".
I want its' width to change in accordance with its' content. If the content of that div is 10 px, border's
width should be 10 px etc..
I tried: "width: auto; margin: auto" and recieved the whole display's width as border's width.
Can anyone give me a suggestion of how to create an "elastic" border attribute?
Thanks
RE: An element (div) enclosed by "border"
If you want it to not be the entire width of its parent element, you can change its display property to inline-block, and its overflow to auto. and give it a min-width if necessary.
CODE
----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
Web & Tech
RE: An element (div) enclosed by "border"
The code is a more complicated then as preseneted here so I hoped I could get a solution without having to present it and I got !!
CODE --> display:inline-block;
RE: An element (div) enclosed by "border"
----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
Web & Tech