html - SVG is visibly clipped, but I still get scroll bars - Cropping SVG -


if have svg element extends beyond size of svg, scroll bars in browser. want stretch svg control size of visible region , don't want elements partially visible cause scroll bars appear on page.

i've distilled down simple example. here's have in body of html document:

<svg width="200" height="200">     <defs>         <clippath id="clippath">             <rect x="0" y="0" width="200" height="200" />         </clippath>     </defs>     <g clip-path="url(#clippath)">         <rect x="100" y="50" width="2000" height="50" style="stroke: red; stroke-width: 5; fill: lightblue" />     </g> </svg> 

as can see svg element defined 200x200 , visibly clipped 200x200. however, when open in browser see scroll bar because rectangle extends out past end of svg element , off page.

how rid of scroll bars? i'd crop svg clip path.

update: seems problem in ie. firefox , chrome render way it.

pretty same css property, should able use overflow:hidden;

as noticed, in case of <svg> inline , shown overflow=hidden.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -