I have the following code.
form {
outline: 3px solid blue;
width: 50px;
/* why doesn't it hold? */
}
.container {
border: 2px solid green;
}
code {
display: block;
overflow: auto;
white-space: pre;
}
<form>
<fieldset class="container">
<code>
<some>
<very>
<looooooooooooooooooooooooong>
<html>
<code>
<here which="should break in multiple lines, or be scrollable">
</code>
</fieldset>
</form>
The problem is, that the <fieldset>
seems to adapt the width from the <code>
element inside, instead of the outer <form>
. The green box should be contained inside the blue box, and the code should be scrollable.
But instead, the green box blasts out of the blue box:
How can I make the <code>
adapt the width from the <fieldset>
which should adapt its width from the <form>
?