<svg width='100%' height='100%' viewBox="0 0 100 100" preserveAspectRatio="none" style='background-color: whitesmoke'> <path stroke="#000" fill="none" d="M0,0 L50,50" /> </svg>Using percentage in svg tag, then the element inside it will be in percentage unit.