Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Headers within <PRE> is not standards-compliant; alternatives?

Reply
Thread Tools

Headers within <PRE> is not standards-compliant; alternatives?

 
 
J44xm
Guest
Posts: n/a
 
      02-17-2005
On my Web page, I have text laid out using a <PRE> tag. However, when I
validate my page, I'm told that header tags -- in my case, <H1> and <H2> --
aren't allowed within <PRE>'s. Is there a way to retain my preformatted
layout and use header tags but within the HTML standard? Or will I just have
to live with not be standards-compliant in this case?

Reference: http://osx.soc.uh.edu/~jdavis/j44xm/freeware.html
--
J44xm, who urges all to quote previous posts judiciously
 
Reply With Quote
 
 
 
 
Barbara de Zoete
Guest
Posts: n/a
 
      02-17-2005
On Thu, 17 Feb 2005 16:39:57 -0600, wrote:

> On my Web page, I have text laid out using a <PRE> tag. However, when I
> validate my page, I'm told that header tags -- in my case, <H1> and <H2> --
> aren't allowed within <PRE>'s. Is there a way to retain my preformatted
> layout and use header tags but within the HTML standard? Or will I just have
> to live with not be standards-compliant in this case?
>
> Reference: http://osx.soc.uh.edu/~jdavis/j44xm/freeware.html


I don't really understand why you use pre for this. It is a bunch of lists. Why
not mark them up as such. Whith lists you can put headers in between all you
want. And you can use CSS to set the font type and use of white space property
to match this <pre> look easily.

--
,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
| weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
| webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
|zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
`-------------------------------------------------- --<--@ ------------'
 
Reply With Quote
 
 
 
 
Disco Octopus
Guest
Posts: n/a
 
      02-17-2005
J44xm wrote :
> On my Web page, I have text laid out using a <PRE> tag. However, when I
> validate my page, I'm told that header tags -- in my case, <H1> and <H2> --
> aren't allowed within <PRE>'s. Is there a way to retain my preformatted
> layout and use header tags but within the HTML standard? Or will I just have
> to live with not be standards-compliant in this case?
>
> Reference: http://osx.soc.uh.edu/~jdavis/j44xm/freeware.html


instead of the <pre> you can try <div style="white-spacere">.

try it.

--
eating alone is medicinal

 
Reply With Quote
 
J44xm
Guest
Posts: n/a
 
      02-17-2005
["Barbara de Zoete"; Thu, 17 Feb 2005 22:44:53 GMT]

> I don't really understand why you use pre for this. It is a bunch of
> lists.


This list was originally a plain-text list. I want to exactly duplicate the
layout of the original text file. This, for one, allows me to copy and paste
the text back into a text file, for one. Thus, <PRE> is my best option.
--
J44xm, who urges all to quote previous posts judiciously
<http://osx.soc.uh.edu/~jdavis/j44xm/freeware.html>
 
Reply With Quote
 
J44xm
Guest
Posts: n/a
 
      02-18-2005
["Disco Octopus"; Thu, 17 Feb 2005 23:50:50 GMT]

> instead of the <pre> you can try <div style="white-spacere">.


Thanks for the reply. Looks great in Firefox but IE6 doesn't handle it
correctly. While how my document appears in IE is a secondary concern to me,
I'm afraid the result is downright illegible in this case!

See: http://www.2and2.net/Uploads/Images/...likes-this.png
--
J44xm, who urges all to quote previous posts judiciously
<http://osx.soc.uh.edu/~jdavis/j44xm/freeware.html>
 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      02-18-2005
"J44xm" <w44kz[@]friragl8.a_g> wrote
> ["Barbara de Zoete"; Thu, 17 Feb 2005 22:44:53 GMT]
>
> > I don't really understand why you use pre for this. It is a bunch of
> > lists.

>
> This list was originally a plain-text list. I want to exactly duplicate

the
> layout of the original text file.


Sticking an <h1> element in the middle of it is *not* exactly duplicating
the layout of the original text file.

> This, for one, allows me to copy and paste
> the text back into a text file, for one. Thus, <PRE> is my best option.


Pre is not your best option if you want to put a <h1> element in the middle
of it.

And BTW I fully expected to be able to click on those links. The way it is I
will never know what is in them


 
Reply With Quote
 
J44xm
Guest
Posts: n/a
 
      02-18-2005
["rf"; Fri, 18 Feb 2005 00:05:28 GMT]

> Sticking an <h1> element in the middle of it is *not* exactly
> duplicating the layout of the original text file.


Fair enough.
--
J44xm, who urges all to quote previous posts judiciously
<http://osx.soc.uh.edu/~jdavis/j44xm/freeware.html>
 
Reply With Quote
 
J44xm
Guest
Posts: n/a
 
      02-18-2005
["J44xm"; Fri, 18 Feb 2005 00:01:28 GMT]

> Thanks for the reply. Looks great in Firefox but IE6 doesn't handle it
> correctly.


Cancel that! I found the error in my coding. Looks like that's the answer to
my problems! Thanks much for your help!
--
J44xm, who urges all to quote previous posts judiciously
<http://osx.soc.uh.edu/~jdavis/j44xm/freeware.html>
 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      02-18-2005
J44xm wrote:

> On my Web page, I have text laid out using a <PRE> tag. However, when I
> validate my page, I'm told that header tags -- in my case, <H1> and <H2> --
> aren't allowed within <PRE>'s. Is there a way to retain my preformatted
> layout and use header tags but within the HTML standard? Or will I just have
> to live with not be standards-compliant in this case?


Instead of this:

<h1>....</h1>

Do this:

</pre><h1>....</h1><pre>

Easy.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
Barbara de Zoete
Guest
Posts: n/a
 
      02-18-2005
On Thu, 17 Feb 2005 17:56:00 -0600, wrote:

> ["Barbara de Zoete"; Thu, 17 Feb 2005 22:44:53 GMT]
>
>> I don't really understand why you use pre for this. It is a bunch of
>> lists.

>
> This list was originally a plain-text list. I want to exactly duplicate the
> layout of the original text file.


Why not serve out the original text file then? Putting the headers in disturbs
this idea of your anyway.

> This, for one, allows me to copy and paste
> the text back into a text file, for one.


Any file will do that. Open the file in your browser --> [Ctrl]+[A] -->
[Ctrl]+[C] --> open text editor --> [Ctrl]+[V]; presto

> Thus, <PRE> is my best option.


Rubbish.

--
,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
| weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
| webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
|zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
`-------------------------------------------------- --<--@ ------------'
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with wsgiref.headers.Headers Phil Python 4 01-17-2010 04:47 PM
Server cannot clear headers after HTTP headers have been sent Ian ASP .Net Security 2 03-20-2007 09:00 AM
Multiple targeted WS-Addressing Headers within a SOAP message? SoftwareGuy Java 0 10-07-2006 09:26 PM
Multiple targeted WS-Addressing Headers within a SOAP message? SoftwareGuy Java 0 10-07-2006 09:26 PM
Reading 'received' headers: Email Headers Parsing dont bother Python 0 03-03-2004 08:18 PM



Advertisments