It is preferred to get the distance correct by hardware changes (leveling screws). But it is possible to do it with software. You can not only change the Z offset in the slicer or in the configuration of Marlin, but also with G-code commands.
The "paper drag" method is perfect for determining the correct Z level. Once you leveled with the paper, you do not need to create an offset to account for the paper thickness, however, there are purists that do that. So basically, what we call Z=0 is in fact Z="paper thickness", unless you are a purist. But a slightly larger gap makes printing much easier. Too small heights cause e.g. rippling effects or too much pressure build-up in the nozzle. In order to change your offset after leveling, you could try one of the following methods. This is sometimes a useful method for creating a little extra offset for printing PETG, but personally I do not do that.
In Ultimaker Cura: Open the plugin manager ("Toolbox"->"Browse packages...") and install "Z Offset Setting", a new parameter will be available in the "Build Plate Adhesion" settings menu called "Z Offset". (See also this older, not up-to-date answer)
In Marlin configuration file, modify the MANUAL_Z_HOME_POS constant:
//#define MANUAL_Z_HOME_POS 0
In G-code:
By adding the following lines to your start G-code (see e.g. this answer) using the G-code command:G92
G0 Z0.2 ; Move the head to 0.2 mm (so now 0.3 on your machine)
G92 Z0 ; Call this Z = 0
or when you are able to connect to the printer over USB using a printer terminal (e.g. Pronterface, Repetier or OctoPrint) using the G-code command:M206
Use M206 to apply a persistent offset to the native home position and coordinate space. This effectively shifts the coordinate space in the negative direction.
M206 Z-0.2 ; Will raise the Z height by 0.2 mm
M500 ; Stores the offset in memory
Alternatively, when you cannot connect through a terminal, putting the last 2 lines in a text file and saving that as a file on an SD card and "printing" the file will also store the new offset (if .gcode is enabled in the configuration file: M500)#define EEPROM_SETTINGS // Enable for M500 and M501 commands
First, the z-offset value for only works on 3D transforms. Luckily, you have one in your fiddle, but it seems like the only value you tried was zero (the default value); not entering a value is the same as entering 0, the default. Think of it as the same principle as the transition-origin: you're telling it how close to the screen it needs to be. z-index
There's an important caveat: values in are reversed from z-offset (as well as z-index). A higher translateZ will move items closer to the screen (since the stacking context starts at 0 and higher stacking levels bring you closer to the screen), but a higher z-index moves the element's origin farther away (since the z-offset is describing how far away an element's z-offset should be, higher z-offset values = farther away).transform-origin
So to understand the 3D graph, consider these axes from the point of view of the z axis ray moving directly toward us.
Looking at this graph, setting a z-offset of would move an element's transform-origin point a little closer to us. Inversely, a z-offset of -38px would move the transform-origin point a little farther away.38px
In this example, however, the span element has already been rotated -80 degrees (I picked 80 instead of 90 so that you can see the rotation a bit easier) along the X axis. This is done first, since 3D Transforms are cumulative, so each transform is done in order, step-by-step (this also means that transforms of parents are inherited by their children). So really, the graph above can now be considered rotated as well, with the z-axis ray pointing down, and the y-axis ray pointing away from us.
Let's take your example and change the z-offset of the additional face to (the length (its height, in CSS terms) of the face that is initially visible) to see how it moves farther away from its origin point. Considering the z-axis ray was pointing down after we applied -38px, that means the z-offset element should move down (since negative z-offset values mean "move closer") to the bottom of the viewport.RotateX(-80deg)
.section-title {
text-align: center;
margin-top: 50px;
color: #FFF;
}
.section-title span {
font-size: 36px;
position: relative;
display: inline-block;
padding: 0px 14px;
background: #2195DE;
transition: transform .5s ease;
transform-style: preserve-3d;
}
.section-title span::before {
position: absolute;
top: 100%;
left: 0px;
width: 150px;
height: 100%;
background: #2195DE;
content: "test";
transform: rotateX(-80deg);
transform-origin: 0px 0px -38px;
text-align: center;
}
.section-title span:hover {
transform: rotateX(80deg);
}
.section-title span:hover::before {
transform-origin: 0px 0px 0px;
}
<div class="section-title">
<span>Product Range</span>
</div>
Now the z-offset face (created with ) has moved closer to the bottom of the viewport. This means it would be 38px (since each side is 38px long) closer to the screen if we hadn't rotated it 80 degrees already. I re-set it back to ::before on hover, so it snaps back to normal position, as you can see by hovering.0px
This property is useful for creating 3D transforms of typically 3D elements. The most obvious choice is a six-sided die. You would use the z-offset to create the back side of the die (along with so that we don't see through the element).backface-visibility: hidden;