Mark Manning

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromMark Manning
ToMe
SubjectHello and well met. Three items
Date5 May 2010 20:07
1. I like your site HowToCreate.  It is a no-nonsense oasis in an otherwise
bloated ocean of web pages.
2. I like your candor.  Quite refreshing without all of the pandering to try
to make people happy.
3. I read your section on what is wrong with IE8 and I believe I have found
an error with all browsers possibly.  Not that I want you to do anything
about it, but here is what I have found in case you are interested in it.:

<html>
<head><title>Test of PRE</title></head>
<body>
<pre>HERE</pre>HERE<pre>HERE</pre>HERE
</body>
</html>

All of the words "HERE" should appear on the same line as there are no line
breaks.  :-)

Enjoy and thanks again for the website you have up.  I was looking for an
explanation of why the above happens.  So far - nothing about this but
thought I'd drop a line.

Later.

Mark Manning
FromMe
ToMark Manning
SubjectRe: Hello and well met. Three items
Date6 May 2010 15:42
Mark,

> <pre>HERE</pre>HERE<pre>HERE</pre>HERE
>
> All of the words "HERE" should appear on the same line as there are no
> line breaks.

There are linebreaks because PRE is defined as a "block" element (like a
paragraph). It is styled by default with the CSS style:
display: block;
which is what produces the linebreaks (linebreaks are also preserved inside
it by the white-space:pre style, with some special handling to make leading
and trailing linebreaks disappear).

It also normally has some top and bottom margins, which produce a bigger gap
than a normal linebreak. A sample default set of styles is given in the CSS
spec:
http://www.w3.org/TR/CSS21/sample.html

I describe the general difference between block and inline elements here:
http://www.howtocreate.co.uk/tutorials/html/text
Note the CODE element, which probably does what you wanted PRE to do.


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromMark Manning
ToMe
SubjectRe: Hello and well met. Three items
Date6 May 2010 21:38
Thanks! I see what you mean. Off to correct my HTML generator. (Which has
been giving me fits because of the PRE tag I was using.) Thanks again.
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.