Set width and height for canvas


I am trying to set the width and height for canvas.If I use percentages the signature pad is not working properly.If I use px it is working fine.

I want the canvas to occupy complete width and height of the parent div.How can I achieve this?

I am using canvas in the popup screen(ionics).