0

Currently, I have my WebKit.WebView in a ScrolledWindow, because otherwise my window would resize to fir the content. In stead, I would like the content to adjust to the container. So text should wrap, in stead of running straight through and resizing the window. A horizontal scroll bar meant to be there, but not a horizontal one.

1 Answer 1

0

You would have to apply a custom stylesheet to all pages, which set the max-width of everything in the page to 100%. If you control all the content being displayed in there, set html,body { max-width: 100%; } in your CSS. If you don't control all the content displayed in your web view, then you will have to allow the horizontal scroll bar to be shown when needed, otherwise you will break pages that need it.

4
  • Really? That sucks :/ Any idea how I can apply a custom style sheet? Do I have to add the style tags and stuff myself, or is there a specific function for this in the WebView widget?
    – RobinJ
    Jun 29, 2012 at 21:51
  • WebKit has API to inject CSS or JavaScript into the DOM, but I don't recall what the exact API is at the moment, or if it is available through the GI (gobject-introspection) bindings.
    – dobey
    Jun 29, 2012 at 21:56
  • Webkit is currently available in the GI
    – Hernantz
    Jun 29, 2012 at 22:13
  • @Hernantz yes it is, but all the API is not fully exposed in the GI bindings.
    – dobey
    Jun 30, 2012 at 14:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .