View Single Post
Old 11-05-2016, 06:32 PM   #13
fbrzvnrnd
Fanatic
fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.
 
Posts: 559
Karma: 400004
Join Date: Feb 2009
Device: ONYX M96
Quote:
Originally Posted by RbnJrg View Post
I think you wouldn't need javascript to do what you want. You are using (under "preserveAspectRatio" property the value ""xMidYMid slice". You should change it for "xMidYMid meet". After that, erase the code for <rect> and instead, use the property "border". For example, try with this:

Code:
<body style="margin:0; padding:0">
    <div style="text-align: center; padding: 0pt; margin: 0pt;">
         <svg xmlns="http://www.w3.org/2000/svg" height="95%" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 600 900" width="100%" style="border: 10px solid black" xmlns:xlink="http://www.w3.org/1999/xlink">
         </svg>
    </div>
</body>
Regards
Rubén
Thank you for the suggestion, but it is not working: the svg image goes outside the page...
fbrzvnrnd is offline   Reply With Quote