The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> HTML that doesn't turn into HTML...., Trying to display HTML for a layout...
seremela
post Oct 4 2006, 05:10 PM
Post #1





Group: Members
Posts: 2
Joined: 4-October 06
Member No.: 331



This is kind of difficult to explain! I want to do free layouts for this website, and need to have the HTML needed displayed on that page, but obviously if I write it as HTML it'll convert it so you can't see it as HTML...if you get me huh.gif Is there a special kind of box or something that makes HTML visible on a webpage? Thanks!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Oct 4 2006, 05:16 PM
Post #2


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



See http://htmlhelp.com/faq/html/basics.html#show-html
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Cameron
post Oct 4 2006, 05:17 PM
Post #3


Novice
**

Group: Members
Posts: 28
Joined: 24-September 06
Member No.: 224



Tags can be done like this: &lt;tag&gt. The tag (or whatever text you choose to type there) is in the middle of &lt; and &gt, which makes it look like this in a browser: <tag>
Hopefully this helps.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Oct 4 2006, 05:18 PM
Post #4


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



QUOTE(Cameron @ Oct 5 2006, 12:17 AM) *

Tags can be done like this: &lt;tag&gt. The tag (or whatever text you choose to type there) is in the middle of &lt; and &gt, which makes it look like this in a browser: <tag>
Hopefully this helps.


&gt; needs a semi-colon too. tongue.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Cameron
post Oct 4 2006, 05:32 PM
Post #5


Novice
**

Group: Members
Posts: 28
Joined: 24-September 06
Member No.: 224



Oops! Can't believe I missed that! Thanks ChristianJ!
Re-done comment below:

Tags can be done like this: &lt;tag&gt;. The tag (or whatever text you choose to type there) is in the middle of &lt; and &gt;, which makes it look like this in a browser: <tag>
Hopefully this helps.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Oct 4 2006, 05:50 PM
Post #6


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



Don't forget to encode ampersands as &amp; (as explained by the FAQ).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
seremela
post Oct 5 2006, 04:00 AM
Post #7





Group: Members
Posts: 2
Joined: 4-October 06
Member No.: 331



Thank you!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
mikeea
post Oct 7 2006, 01:00 AM
Post #8





Group: Members
Posts: 4
Joined: 7-October 06
Member No.: 355



Just to be a smarty...

You could use a textbox and set the initial value of the box to be your coding. They could then copy your coding and paste it where needed. smile.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Oct 7 2006, 11:36 AM
Post #9


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



QUOTE(mikeea @ Oct 6 2006, 11:00 PM) *
You could use a textbox and set the initial value of the box to be your coding. They could then copy your coding and paste it where needed. smile.gif
But you'd still need to encode special characters. Actually, depending on what you mean by "a textbox", you might need to encode quotes as &quot; as well.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
SkyB0lt
post Oct 8 2006, 03:23 PM
Post #10


Novice
**

Group: Members
Posts: 21
Joined: 27-September 06
Member No.: 253



Ok, I cant seem to get this perfected. It works fine in the page but then I cant seem to show the &code without the validator getting mad.

Here is my HTML code.

<CODE>&amplt;TAGUSED&ampgt;</CODE>.<BR><BR> This is cool, and to make the & sign show in the code i had to add the text amp before the lt. it is like this but put together. <CODE> &&nbsp;amp&nbsp;lt</CODE>. Notice the amp does not show.

The validator says this

Warning Line 238 column 8: cannot generate system identifier for general entity "amplt".

What am I doing wrong?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Oct 8 2006, 03:39 PM
Post #11


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



What Darin meant was that if you want an ordinary ampersand ("&") to appear on a web page you should encode it as "&amp;", otherwise a browser may interpret the "&" as the beginning of an entity ( such as "&lt;", etc).

The validator complains because there is no entity like "&amplt;". And while "&amp;&lt;" are two valid entities they are probably not what you want, since they will render as "&<".


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
SkyB0lt
post Oct 8 2006, 03:43 PM
Post #12


Novice
**

Group: Members
Posts: 21
Joined: 27-September 06
Member No.: 253



So how should I both make the validator happy and show the code?

Shawn
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Oct 8 2006, 04:38 PM
Post #13


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



Something like this perhaps:

CODE
&lt;P&gt;
Some text
&lt;P&gt;


..which should render in your HTML example as:

CODE
<P>
Some text
</P>


If you want to show the "&amp;" entity in a code example you must write:

CODE
&lt;P&gt;
Some text &amp;amp; some more
&lt;P&gt;


..which should render in your code example as:

CODE
<P>
Some text &amp; some more
</P>


Then when someone pastes the code example into his own HTML document, the text will render in a browser as

Some text & some more
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
SkyB0lt
post Oct 8 2006, 05:02 PM
Post #14


Novice
**

Group: Members
Posts: 21
Joined: 27-September 06
Member No.: 253



Wow you are GREAT!!

I cant believe it was so easy!

I was simply missing one thing in two places!

; was all that was missing.

Wow coding is a pain.

Thanks for the help your great!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 24th April 2024 - 11:02 PM