Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

249
Views
Google Chrome extension margin/blank space insert for image

I'm designing a Google Chrome extension. It is designed to insert an image into text. It currently does so, but the image attached at the bottom shows my problem. The image displays over text, and I was wondering if there was a way to make the image have its own separate space, as if I was using margin - so the snake is to the left of the logo and all of the links, and everything else on the page is shifted to the right slightly. Neither marginLeft nor marginRight work, though. This is my code:

popup.js:

  function imageappend() {
    const img = document.createElement("img");
    img.src = chrome.runtime.getURL("imageedit_1_3932659157.png");
    img.style.position = "fixed";
    img.style.top = "0";
    img.style.left = "0";
    img.style.padding = "0";
    img.style.marginRight = "7%";
    img.style.marginLeft = "0";
    img.style.marginBottom = "0";
    img.style.marginTop = "0";
    img.style.width = "5%";
    document.body.appendChild(img);
  }

  let [tab] = await chrome.tabs.query({ active: true, currentWindow: true });

  chrome.scripting.executeScript({
    target: { tabId: tab.id },
    function: imageappend
  });
})();

Image spawns over text

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!