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 8125367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:47:31+00:00 2026-06-06T06:47:31+00:00

I want to put elements on a page by mouse click, exactly where the

  • 0

I want to put elements on a page by mouse click, exactly where the user clicks. So I enter an string to the div by .append().

The problem is: how can I input two elements into div without other elements effect. I tried absolute position by margin and relative by top and left, but no result,

Here in this (demo..) I simplified what I am trying to do, by clicking on generator1 and generator2, on the page should appear two buttons side by side, but appears each on on a row.

hmm, another thing: "I am a n00b in CSS" 😉

  • 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-06T06:47:33+00:00Added an answer on June 6, 2026 at 6:47 am

    DEMO: http://jsfiddle.net/KADqt/2/

    An absolute positioned element won’t affect other elements, as it’s removed from the document flow. Also, just use top, and left, instead of margin-top, margin-left.
    An absolute positioned element will position itself off it’s nearest non-static parent element. In the demo above, I have changed the position of the container to relative – so the new absolute positioned elements will base their top/left values off it’s container.

    EDIT: I have updated the demo to include random top/left values for the first generator button, to illustrate that no other elements are being affected by newly generated ones.

    Second EDIT: I have added another click handler to demonstrate how you would go about positioning an element relative to where the user clicks, which you mentioned wanting.

    DEMO: http://jsfiddle.net/KADqt/4/

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

Sidebar

Related Questions

How can I register a javascript code a page? I want to put th
I have a Zend_Form_Element_Multicheckbox and I want to put some of its elements in
hey, hi i want put limit on object creation means a class can have
I want to put the user password check to never expire. When I create
I want to put facility to display distance between two places selected by user.
I am designing a web page for playing some movies. I want user to
My page contains some drag-able div elements ( not jQuery UI dragable ). Now
I got a DIV positioned absolute above other elements on the page and I
On my page I have a lot of various elements which respond to click
I see some anchor elements on an html page like so <a href=javascript:void(0); class=clickable>Click

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.