Forums

Scrolling CODE, overflow-x:scroll, how to edit <code> tag (12 posts)

  1. albinas
    Member
    Posted 5 years ago #

    hello,

    i want to make my posts code scrollable because sometimes it is too wide.

    in css i tried this:

    'code, pre {
    color: #F26722;
    font: 12px "Courier New";
    background-color:#F6FCFD;
    border-width:1;
    border-color:#BEBEBE;
    border-style:dotted;
    padding:4px;
    width:515px;
    overflow-x:auto;
    overflow-y:hidden;
    }'

    Can you tell me what is wrong with that?

    Looking forward to your answers.

    a.

  2. Nicki Faulk
    Member
    Posted 5 years ago #

    Are you viewing in IE, Firefox, or both? If I remember correctly, this overflow-x/y only works for IE.

  3. albinas
    Member
    Posted 5 years ago #

    This one dont work on both

  4. albinas
    Member
    Posted 5 years ago #

    Is it so hard to do?

    Maybe this one don't work because in wordpress code is not a <div> ?

    Looking forward to your answers...

  5. Chris_K
    Member
    Posted 5 years ago #

    To be clear, it isn't a WordPress issue. WP doesn't really give a dump if your theme uses divs or not. Heck some folks do themes in tables still.

    It's a theme (aka (x)html/CSS) issue.

    I use a plugin for code samples. Among other things, it styles them
    overflow-x: auto;
    overflow-y: auto;

    See it in action. So, I'm pretty sure it can be done. :-p

    If you're curious, the code plugin is: http://blog.igeek.info/wp-plugins/igsyntax-hiliter/

  6. Nicki Faulk
    Member
    Posted 5 years ago #

    :o

    OMG ... that is SEXY!

    Sorry, couldn't help myself. Solo, that's tight dude! :)

  7. albinas
    Member
    Posted 5 years ago #

    hmm, i installed and activated the iG:Syntax Hiliter plugin, but no changes have been made in a posts, the code spot on the post left exactly as it was before...

  8. whooami
    Member
    Posted 5 years ago #

    you have to format the code within the posts -- it doesnt arbitrarily change what already there. Look at the boxes above the post box ...

    you should see little buttons for php, perl, etc..

    It (whatever you want to format) needs to be wrapped in the proper tags: [php] [/php] ..etc, thats what the buttons simplify.

  9. albinas
    Member
    Posted 5 years ago #

    Well, thats bad... :(

  10. whooami
    Member
    Posted 5 years ago #

    no it isnt, changing code that you might not want chage is bad. thats how things work -- for instance, if you want something encased in a div, you are expected to provide div tags. It doesnt happen magically.

  11. albinas
    Member
    Posted 5 years ago #

    Yeah, but i have many posts with too wide code. And I have to edit all of them?... Nah... :)

    I cant believe there is no easier way to make the code scrollable...

  12. Zhu8
    Member
    Posted 5 years ago #

    I have an idea, You can use this code:
    div.post(or#post) p, ol#commentlist li p {
    overflow : auto;
    }

    it can make the paragraph with code have scroll with it.

    it's the only way you can use without a code plugin - I haven't found other ways to solve it...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags