The essence is, there is a samopisny widget, embedded by js in the <head> . If the site has a standard container class, then everything is fine, but if not, then the widget elements can be shifted horizontally. For a little clarity (very roughly): enter image description here

It is required that the border always coincides with the boundary of the content, how can this case be calculated?

Tried to calculate the width first div in body $('body > div').css("width"); but there may be anything, I would like a universal and reliable solution. Gave a link to the curve of the site, it is necessary that even on it normally displayed ( curve site ).

  • This is a very crap affair. far from all sites such layout as in the example. Moreover, on some sites, the first div can only serve as a wrapper and sweep across the width. - Tsyklop
  • about that and speech. that the first div is not an option to watch and that the layout is different everywhere, so I would like to know the width of the content on the site to dynamically set the width of the widget. - medvedev
  • One option is to go through the elements after the body and take the first element whose internal width is less than the width of the screen, not taking into account the padding and margin. - Tsyklop
  • An interesting idea, of course, does not give guarantees, but at least something. Thank! - medvedev

0