diff --git a/openlp/core/display/html/display.js b/openlp/core/display/html/display.js
index fd10d4e55..67ef7355d 100644
--- a/openlp/core/display/html/display.js
+++ b/openlp/core/display/html/display.js
@@ -1028,7 +1028,7 @@ var Display = {
// These need to be fixed, in the Python they use a width passed in as a parameter
mainStyle.width = theme.font_main_width + "px";
mainStyle.height = theme.font_main_height + "px";
- mainStyle.top = "" + theme.font_main_y + "px";
+ mainStyle["margin-top"] = "" + theme.font_main_y + "px";
mainStyle.left = "" + theme.font_main_x + "px";
mainStyle.color = theme.font_main_color;
mainStyle["font-family"] = theme.font_main_name;
diff --git a/tests/js/test_display.js b/tests/js/test_display.js
index ce0298e37..1fb7aaaae 100644
--- a/tests/js/test_display.js
+++ b/tests/js/test_display.js
@@ -717,7 +717,7 @@ describe("Display.setTextSlides", function () {
Display.setTextSlides(slides);
const slidesDiv = $(".text-slides")[0];
- expect(slidesDiv.style['top']).toEqual('789px');
+ expect(slidesDiv.style['margin-top']).toEqual('789px');
expect(slidesDiv.style['left']).toEqual('1000px');
expect(slidesDiv.style['width']).toEqual('1230px');
expect(slidesDiv.style['height']).toEqual('4560px');