I have a centered column of text, which has a fixed width. However, I want to break that fixed width for <pre> (and some other tags), where they fill the full screen width, while keeping flow with the text.
So far, I have the following CSS:
pre {
float: left;
left: 0;
padding: 1em;
position: absolute;
}
So, in this HTML fragment, the paragraphs are in a centered column on the page, which is correct.
<div class="bodice">
<p>Some text. Some more text.</p>
<pre>Here's some code!</pre>
<p>Yet more text. And some more text.</p>
</div>
However, the text within the <pre> is not flowed overlaps, which isn’t quite the effect I want. It does have the correct position: aligned against the left side of the screen.
A more complete example, at jsFiddle: http://jsfiddle.net/Jashank/VbKDP/
How do I have the <pre> flowing with rest of the paragraphs while aligning it to the left?
So, after some discussion I finally think I understood what you were looking for.
html
css
example
There’s a jsfiddle where you can view this solution in action.