javascript - Make div 50% width of its contents -
javascript - Make div 50% width of its contents -
i have been looking around google/forums , havent found reply this. wondering if can, in css, size div 50% width of contents. see calc() doesnt work auto, want accomplish width: calc(auto/2). can in css, or have done after page loaded in javascript/jquery?
note:the height 100% image in wont want utilize px values.
assuming internal content image, maybe this:
var innerwidth = $('.parentdiv').children('img').width(); $('.parentdiv').css('width', innerwidth);
maybe i'm misunderstanding question, don't see why wouldn't work. hope helps :)
edit: agreeing comments said - there isn't way utilize css figure out size of child.
javascript jquery html css
Comments
Post a Comment