Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8773933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:26:00+00:00 2026-06-13T18:26:00+00:00

I’ve written a design editor in html and jquery, which allows people to add

  • 0

I’ve written a design editor in html and jquery, which allows people to add textboxes, images, etc and build up a design. To do this, I have a div with a border that serves as the canvas, and the user can add text or images by clicking on buttons that dynamically create draggable, resizable divs, etc, pretty much like adding an image or anything on top of the canvas in Photoshop or Illustrator, or like adding text boxes and images in MS Word.

My question is, how can I add margin guidelines near the edges of the canvas? I’m talking about being able to see the lines similar to how we can choose to “Show Grid” in other editing software. (I don’t want a grid though, just the margin lines half a cm from the edges).

I considered using a PNG image that was completely transparent except for margin lines near the edges, and then stretching this image over the canvas, $('#content'). However, every text or image that is placed on top of it will cover the lines. I don’t really mind this, but could there be a way to show the lines at all times? I can’t give it a higher z-index than the items on the canvas because they will not then be clickable or editable, since the PNG image would cover everything. It’s the same thing if I use a bordered div inside $('content'), because again it would make things behind it unclickable.

Please bear in mind that the margin lines are only a visual aid, the user can still place things that overstep this line. Any ideas?

Is there anyway something like this could be done:

#content{ border:1px dotted gray; border-position: -5px; } 

so that it kind of pushes the content DIV’s border inside the DIV, instead of at the edge?

Or are there any other ways to add the margins?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:26:02+00:00Added an answer on June 13, 2026 at 6:26 pm

    Just a quick idea : could you put 4 divs inside your canvas, one at the top, one at the bottom and one on each side ?

    Each div could have a width (or height) of a few pixels (your margin), and only one dashed border toward the center of the canvas. This way, you could use a z-index on those divs without hiding the content under it (at least inside the margins…)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.