#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Posts
    351
    Rep Power
    45

    Make a <div> editable?


    I felt sure I once used css to make the content of a <div> editable, but I can't remember where, and now I can't remember how, or even if I just dreamed it because it isn't possible.

    Seems like there was a css property like "iseditable:" or something like that, though that guess isn't right.

    Anybody have ideas?
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Location
    The Pleiades
    Posts
    299
    Rep Power
    9
    When you say you want to edit it, do you mean the way it looks, the content or you want some dynamic effect done?

    Regards,

    NM.
  4. #3
  5. Code Monkey V. 0.9
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2005
    Location
    A Land Down Under
    Posts
    2,118
    Rep Power
    1990
    There's no such thing as an editable div in standard HTML. If you had that before at any time it would have most likely been a JavaScript extension that creates a hidden textarea and shows that when you try to edit the div tag.
  6. #4
  7. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Hi,

    maybe you mean the contenteditable attribute. This has nothing to do with CSS, though.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Posts
    351
    Rep Power
    45
    Originally Posted by Nanomech
    When you say you want to edit it, do you mean the way it looks, the content or you want some dynamic effect done?

    Regards,

    NM.
    Meaning put the cursor in the div and start typing in it.
  10. #6
  11. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Location
    The Pleiades
    Posts
    299
    Rep Power
    9
    The only thing I can of which is similar is a <textarea>. but I think you have to put <textarea>'s inside a <form> tag.

    Try putting this:
    Code:
    <textarea rows="5" cols="30"></textarea>
    P.S - You don't have to specify the rows or cols, HTML does that automatically, you only add the rows and cols attributes if you want to increase/decrease the size of the text area..

    Regards,

    NM.

IMN logo majestic logo threadwatch logo seochat tools logo