Formatting code-tag failed / Help needed

I’m trying to format the <code>-tag here:

I want it to be:

  • 100% wide (of the parent container)
  • the text inside should have a horizontal scrollbar (reason: no wrapping of text inside)

Problem: the width: 100% is not working, it makes the code-container wider than the parent container and no scrollbar is shown!
If I use a fixed value, eg 200px, then I got the horizontal scrollbar!

So this is the problematic part:

  code {
    display:block;
    white-space:pre;
    //word-wrap: nowrap;
    overflow-x:scroll;
    max-width:100%;
    width:100%;
...
}

Any help is welcome. Thanks!