Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Hide Text, But Not Cursor

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #187850
    RickyYoder
    Participant

    Hey everyone, I’ve been trying to make my own code editor, and so far it’s going great. I’m building it from scratch, and it is coming along nicely actually.

    My issue is that I have 2 elements that display the code you are typing.
    A div with the class of ‘highlighter’ (for syntax highlighting) and the textarea you type into, which is placed on top of the syntax highlighter div.

    This isn’t TOO bad, but when things are like this, the highlighter can only give things like brackets and braces a text shadow/background to be seen well.

    So what I decided to do was take the textarea, and make the text transparent. That way you only see the output in the syntax highlighter div, and I can highlight using text color instead of background color.

    My issue is stated in the topic, I want to hide the textarea text, but not the cursor! If you can’t see the cursor, you don’t know where you’re typing, and that is obviously a huge issue.

    TL;DR

    Is there any way to hide the textarea text, but keep the cursor in CSS?
    If not, is there a JavaScript alternative for a fake cursor?

    Take a peek at the editor

    #187855
    itsLeon
    Participant

    color:transparent?

    #187856
    RickyYoder
    Participant

    Wishful thinking. That hides the cursor.

    #251465
    cstff
    Participant

    I also wanna make my own web code editor. But when you ask some thing about , the people always question why you donĀ“t use one of the editor availables. But the idea is make the editor your self. Can you tell me from where you start?

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.