I created a
The best way I have found is:
for landscape: for portrait: You need to determine which side is longer and accept this dimension as 100%
then calculate [ratio] - percentage of shorter dimension in relation to 100% longer dimension. Then use the one of solutions above. to draw a top line at the top of the page:
width:100%;
height:0;
padding-top:[ratio]%;
width:[ratio]%;
height:0;
padding-top:100%;