0

I want to have a div show up in the top right corner of the page so that is can exactly correspond to the location of a paper label when I print it.

Here is what I'm trying, and it's not working.

<div style="background-color: lightgrey; position: fixed; height: 5.1cm; width: 8.8cm; right: 0.6cm; top: 2.2cm;">
  Lorem ipsum dolor sit amet, consectetur adipiscing elit
</div>

The rectangle should be 0.6 cm from the right edge of the page and 2.2 cm from the top. Instead it is about 4 cm from the top and about 5cm from the right.

How can I set the size and location in cm so that this rectangle shows up in the top right>

EDIT: Here is what I'm getting. The yellow is the margin. You can see the the grey box is very far from the top and right. enter image description here

Jeff Wolski
  • 6,332
  • 6
  • 37
  • 69

2 Answers2

0

The issue may be that your label printer is unable to print to the edge of the label, so it scales your artwork down to a printable area with padding around the edge of the label.

I don't know enough about your printer to diagnose, but see if there are any options like "100% scaling" or "no scaling" available.

Jacob Ford
  • 4,553
  • 5
  • 27
  • 42
0

It may depent your browser So try different values for height width and margins

Sumithran
  • 6,217
  • 4
  • 40
  • 54