Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member mehashi's Avatar
    Join Date
    May 2009
    Location
    UK
    Posts
    2
    Member #
    19007
    Hello ^_^

    I have a website and part of it includes some basics of setting up a simple html page with a simple css style. The only problem is that I do not know what to do to display html code on the page in text format without the browser treating it as code.

    At the moment I have written [html] for example and told people to replace the [ and ]'s with < and >'s but I do not like this solution. I believe there may be a way to tell the browser to treat the code as simple text but I do not know it.

    PHP Code:
    <html>
    Something like this would be fine!
    Without a box would be preferable though
    If anybody could help me I would be very greatful! Thank you for your patience!
    ^_^b

  2.  

  3. #2
    Senior Member diddy's Avatar
    Join Date
    Jun 2008
    Location
    Sydney, Australia
    Posts
    502
    Member #
    16955
    There was a tag, <pre></pre> I think it was called, but that was omitted in xhtml I think.

    You could always put the text in a text area, like this:

    HTML Code:
    <textarea rows="30" cols="10">
    <html>
    text
    </html>
    </textarea>
    There's probably a better way of doing this though. I'll think about it a bit more.

  4. #3
    Senior Member ravensjeff's Avatar
    Join Date
    Aug 2007
    Location
    Maryland
    Posts
    125
    Member #
    15751
    A text area is the easiest method.

    Otherwise you have convert all of your < to &lt; and your > to &gt; etc.

    There are a couple of online tools that will do this for you. Here is one.

    You should place your code inside <code></code> tags once you have it converted. You can then apply css to your code tags to style it as you like.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:30 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com