HTML - Displaying Code As Text
How do you display code as text on the page, rather than running it?
Like you do here in between [*code][*/code] tags. Thanks. Similar TutorialsCan someone take a look at this page: http://www.robotsandcomputers.com/ro...wcomplaint.htm in IE and tell me why the text isn't showing up? It shows up just fine in Chrome and Firefox. Thanks... This is probably basic, but it's driving me mad. I want to show a bit of code that the reader can copy. How can i do this? Hi I have a Flash and HTML version of my friends site at www.backlash.net.au On the main page, I have an ABOUT and NEWS section, that gets it's text from external .txt files. Problem is, the text gets formatted without line breaks in the HTML version, but fine in Flash. I was wondering if there is a better way to import the text, whilst only having one external source for each section, and still keeping the process simple (my friend isn't too computer savvy)? I thought of using a php include, and having my friend just enter the text in a simple HTML editor. I can set that up for HTML, but am unsure how to import the PHP page into Flash. Any ideas on the best way to tackle the problem? Thanks for your time and info. Shaun I would appreciate anyone's help in determining why my text is not going all the way to the right side of the "maintext" container. You can view the problematic webpage at: http://www.cornerstonecontractingcom...emp/about.html The associated CSS can be viewed at: [url="http://www.cornerstonecontractingcompany.com/temp/default.css"]http://www.cornerstonecontractingcompany.com/temp/default.css[/URL Thank you very much for your help. Hey guys been having a few problems finding resources on how to vertically align text. what it is is that i have a division i wish to display text in vertically... Any ideas? div{vertical-align: -50%} thats what i came up with but still no joy... I am working on "thumbnails", everything shows fine in IE but in FF the "alt" text does not show, what can I do to get the alt text to show in FF please? When I place links on my bands myspace page the link text displays on the page vertically instead of horizontally on some computers. It displayed correctly (Horizontally) on the PC I created it on, but when i view it on other PCs the text was vertical. Here is the page. It's the white text near the top. (Add To Friends, Send Message etc.) http://profile.myspace.com/index.cfm...ndid=445328869 or www.myspace.com/theengineersband1 Here is the code for the links. I am a beginner with HTML. Thanks, James Kelly HTML Code: <a href="http://www.msplinks.com/MDFodHRwOi8vbWVzc2FnaW5nLm15c3BhY2UuY29tL2luZGV4LmNmbT9mdXNlYWN0aW9uPW1haWwubWVzc2FnZSZmcmllbmRJRD00NDUzMjg4Njk=" style="position:absolute; top:360px; left: 160px;"><font size=1; color=white><b> Send Message</a> <a href="http://www.msplinks.com/MDFodHRwOi8vZnJpZW5kcy5teXNwYWNlLmNvbS9pbmRleC5jZm0/ZnVzZWFjdGlvbj1pbnZpdGUuYWRkZnJpZW5kX3ZlcmlmeSZmcmllbmRJZD00NDUzMjg4Njk=" style="position:absolute; top:360px; left:290px;"><b><font size=1; color=white>Add To Friends </a> <a href="http://www.msplinks.com/MDFodHRwOi8vZnJpZW5kcy5teXNwYWNlLmNvbS9pbmRleC5jZm0/ZnVzZWFjdGlvbj1ibG9jay5ibG9ja3VzZXImdXNlcklEPTQ0NTMyODg2OQ==" style="position:absolute; top:360px; left:425px;"><b><font size=1; color=white>Block </a> <a href="http://www.msplinks.com/MDFodHRwOi8vbWVzc2FnaW5nLm15c3BhY2UuY29tL2luZGV4LmNmbT9mdXNlYWN0aW9uPW1haWwuZm9yd2FyZFYyJmZyaWVuZElEPTQ0NTMyODg2OSZmPWZvcndhcmRwcm9maWxl" style="position:absolute; top:360px; left:510px;"><b><font size=1; color=white>Forward </a> <a href="http://viewmorepics.myspace.com/index.cfm?fuseaction=user.viewAlbums&friendID=445328869" style="position:absolute; top:355px; left: 620px;"><b><font size=1; color=white>View Pics </a> <a href="http://www.myspace.com/topshelfrecords" style="position:absolute; top:360px; left: 700px;"><b><font size=1 color=white>TSR </a> Hey all, I'm having a problem with html input text fields. I'm trying to display a name in it but it only shows the first part of that name. Here is the part of the code I'm using for one of those : Code: <label>Name <span class="small">Name sent</span> </label> <input type="text" name="name" id="name" value=<?php echo $_POST["name"]; ?> /> If, as example, the name I'm getting from $_POST is : Alexander Johnson, there will only be Alexander in the text field. Note that if I create a really small function like this : Code: $name = $_POST["name"]; echo $name; Then the output will be Alexander Johnson instead of simply Alexander. Anyone knows what I'm doing wrong? (I'm using the labels and span class with css, but I don't think this is the problem. Hi all im really new to html. I guess this question is really basic to the expert html ers but just need a bit of help. I want to add some text say i got a <p> tag and want to write just a sentance such as .. <p>I am learning html, it uses tags like this <a,b> which can load images etc. </p> of course a,b isnt a tag, but if i load this basic text in a web browser it would ignore the <a,b> and come up as validation error in the validator. So pretty much is there a way around of displaying <any letters or words> without the browser thinking its some sort of tag? thanks for the help! Is there a way to randomly display text in an element? Im wanting to do somewhat of a "Did you know?" section on my site with random facts about our particular industry. Any help would be awesome! Thanks in advance! Scott I'm trying to make a sidebar to navigate through the website and basically lays out the entire site on the sidebar (which is a tree with nodes and leafs etc), but when it tries to display the text, it gets really squished up on the right side, but there are still horizontal scrollbars -.- This is the html after all the PHP stuff: Edit: I put in "width:100em;" in the li section of css. It formatted the text properly, but then the scrollbar continues on forever. Is there any way to find out how many pixels are needed to format the text properly? More specifically, is there any way (javascript, php) to find the length of a string in pixels? HTML Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("div#navigation").height(window.innerHeight-16); }); </script> <!--<link type="text/css" rel="stylesheet" href="Styles.css" />--> <style type="text/css"> #navigation { position:absolute; width:25%; height:500px; background-color:#C0C0C0; margin:0px; border:0px; padding:0px; float:left; overflow:scroll; overflow-x:scroll; overflow-y:scroll; } #main { width:75%; height:100%; } li { overflow:visible; } </style> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled</title> </head> <!--Use a tree for this--> <div id="navigation" > <ul><li>FoodFoodFoodFoodFoodFoodFoodFoodFoodFoodFoodFoodFo</li> <ul><li>FruitFruitFruitFruitFruitFruitFruitFruitFruitFruit (Level 2)</li> <ul><li>RedRedRedRedRedRedRedRedRedRedRedRedRedRedRedRedRe (Level 3)</li> <ul><li>CherryCherryCherryCherryCherryCherryCherryCherryCh (Level 4)</li> <li>StrawberryStrawberryStrawberryStrawberryStrawberry (Level 4)</li> <ul><li>Uber BerryUber BerryUber BerryUber BerryUber Berry (Level 5)</li> <ul><li>Extreme StrawberryExtreme StrawberryExtreme Strawb (Level 6)</li> <ul><li>WOWWOWWOWWOWWOWWOWWOWWOWWOWWOWWOWWOWWOWWOWWOWWOWWO (Level 7)</li> <ul><li>supercalifragilisticexpialadocioussupercalifragi i (Level 8)</li> </ul></ul></ul></ul></ul><li>YellowYellowYellowYellowYellowYellowYellowYellowYe (Level 3)</li> <ul><li>BananaBananaBananaBananaBananaBananaBananaBananaBa (Level 4)</li> </ul></ul><li>MeatMeatMeatMeatMeatMeatMeatMeatMeatMeatMeatMeatMe (Level 2)</li> <ul><li>BeefBeefBeefBeefBeefBeefBeefBeefBeefBeefBeefBeefBe (Level 3)</li> <li>PorkPorkPorkPorkPorkPorkPorkPorkPorkPorkPorkPorkPo (Level 3)</li> </ul></ul></ul></div> </html> I am trying to display some long text in a <PRE> tag to preserve formatting. When there is really long text in a <pre> tag, part of the text is not displaying on the screen when you scroll over. All of the text is there when I do a view source, but on the screen part of it is hidden and only shows up when highlighted with a mouse. I am not sure if there is some kind of character limitation in PRE or what but I just cannot figure this out. And like I said, this only happens in IE. Works fine in Netscape/FireFox Here is the html if you want to look at it yourself in a page. If you scroll over, you can see the "|" display only up to 3900 and then they are hidden: <pre>0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350 360 370 380 390 400 410 420 430 440 450 460 470 480 490 500 510 520 530 540 550 560 570 580 590 600 610 620 630 640 650 660 670 680 690 700 710 720 730 740 750 760 770 780 790 800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990 1000 1010 1020 1030 1040 1050 1060 1070 1080 1090 1100 1110 1120 1130 1140 1150 1160 1170 1180 1190 1200 1210 1220 1230 1240 1250 1260 1270 1280 1290 1300 1310 1320 1330 1340 1350 1360 1370 1380 1390 1400 1410 1420 1430 1440 1450 1460 1470 1480 1490 1500 1510 1520 1530 1540 1550 1560 1570 1580 1590 1600 1610 1620 1630 1640 1650 1660 1670 1680 1690 1700 1710 1720 1730 1740 1750 1760 1770 1780 1790 1800 1810 1820 1830 1840 1850 1860 1870 1880 1890 1900 1910 1920 1930 1940 1950 1960 1970 1980 1990 2000 2010 2020 2030 2040 2050 2060 2070 2080 2090 2100 2110 2120 2130 2140 2150 2160 2170 2180 2190 2200 2210 2220 2230 2240 2250 2260 2270 2280 2290 2300 2310 2320 2330 2340 2350 2360 2370 2380 2390 2400 2410 2420 2430 2440 2450 2460 2470 2480 2490 2500 2510 2520 2530 2540 2550 2560 2570 2580 2590 2600 2610 2620 2630 2640 2650 2660 2670 2680 2690 2700 2710 2720 2730 2740 2750 2760 2770 2780 2790 2800 2810 2820 2830 2840 2850 2860 2870 2880 2890 2900 2910 2920 2930 2940 2950 2960 2970 2980 2990 3000 3010 3020 3030 3040 3050 3060 3070 3080 3090 3100 3110 3120 3130 3140 3150 3160 3170 3180 3190 3200 3210 3220 3230 3240 3250 3260 3270 3280 3290 3300 3310 3320 3330 3340 3350 3360 3370 3380 3390 3400 3410 3420 3430 3440 3450 3460 3470 3480 3490 3500 3510 3520 3530 3540 3550 3560 3570 3580 3590 3600 3610 3620 3630 3640 3650 3660 3670 3680 3690 3700 3710 3720 3730 3740 3750 3760 3770 3780 3790 3800 3810 3820 3830 3840 3850 3860 3870 3880 3890 3900 3910 3920 3930 3940 3950 3960 3970 3980 3990 4000 4010 4020 4030 4040 4050 4060 4070 4080 4090 4100 4110 4120 4130 4140 4150 4160 4170 4180 4190 4200 4210 4220 4230 4240 4250 4260 4270 4280 4290 4300 4310 4320 4330 4340 4350 4360 4370 4380 4390 4400 4410 4420 4430 4440 4450 4460 4470 4480 4490 4500 4510 4520 4530 4540 4550 4560 4570 4580 4590 4600 4610 4620 4630 4640 4650 4660 4670 4680 4690 4700 4710 4720 4730 4740 4750 4760 4770 4780 4790 4800 4810 4820 4830 4840 4850 4860 4870 4880 4890 4900 4910 4920 4930 4940 4950 4960 4970 4980 4990 5000 5010 5020 5030 5040 5050 5060 5070 5080 5090 5100 5110 5120 5130 5140 5150 5160 5170 5180 5190 5200 5210 5220 5230 5240 5250 5260 5270 5280 5290 5300 5310 5320 5330 5340 5350 5360 5370 5380 5390 5400 5410 5420 5430 5440 5450 5460 5470 5480 5490 5500 5510 5520 5530 5540 5550 5560 5570 5580 5590 5600 5610 5620 5630 5640 5650 5660 5670 5680 5690 5700 5710 5720 5730 5740 5750 5760 5770 5780 5790 5800 <br/>| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | </pre> Thanks I have three user input text boxes called; "name", "email" and "phone" and one text field to display that information called; "feedback". When a "Submit" button is clicked, the three text boxes are validated to check that what was typed inside them was OK. I then want to display the Users' name, email and phone number on individual lines in the text field, for example, name on line 1, email on line 2 and phone number on line 3. At the minute when I submit the information only the phone number displays on the first line of the text box. In the text field "feedback"; I know the HTML probably interprets my code as; the name is being replaced by the email and then the email is being replaced by the phone number. Here is the relevant section of my code. function validate(){ if (validateName () && validateEmail() && validateformatNumber()){ var myName=document.survey.visitor.value; document.survey.feedback.value=myName; var myEmail=document.survey.email.value; document.survey.feedback.value=myEmail; var myPhone=document.survey.phone.value; document.survey.feedback.value=myPhone; return true; }else{ return false; }} I think the solution could be something simple but I haven't much of an idea of how to do it. Thanks in advance. Can't figure out why the page is displaying only HTML code. My assumption is: I indicated a wrong path to the image hosted with 000webhost.com. Otherwise I have no clue why the code doesn't display online. Here is the code. Can anybody spot the problem? Thanks in advance! =========================================== HTML Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv = "content-type" content = "text/html; charset = utf-8"/> <title>Russkaya Zvezda</title> </head> <body> <table width='100%'> <tr> <td align ='center'> <img src = "http://www.russkayazvezda.com/GRAY_VK_RZ_MY_RABOTAEM_raster.jpg" width = "100%" alt = "RUSSKAYA ZVEZDA"/> </td> </tr> <tr> <td> <p style = "text-align: center;"> Copyright © 2000 - 2012 by Russkaya Zvezda Inc. </p> </td> </tr> </table> </body> </html> Hi, I am creating a form in which i have a dropdown menu. According to the selection(s) in drop down menu, that many text field(s) should be shown below that drop down menu. Have a look at this code... <html> <head> <title> Sample Application </title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script> function callMe() { if(document.MyForm.dropDownValue.value != ""){ document.getElementById("txtBox").style.visibility = "visible"; } else{ document.getElementById("txtBox").style.visibility = "hidden"; } } </script> </head> <body> <form name="MyForm"> <table> <tr> <td> <select name="dropDownValue" onchange="callMe();"> <option value="">--None--</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> </tr> <tr id="txtBox" style="visibilty:visible"> <td> Enter Your Value He </td> <td> <input type="text" name="txtEntry" value=""> </td> </tr> </table> </body> </html> : the problem is: when I select 2, it suppose to show 2 text fileds and 3 when i select 3 accordingly. I am new to this stuff...so,can any one help me out ASAP pls?? thanks , i will be waiting for your reply... -S http://goldenworldgoods.awardspace.com/ Hello again, I did this site in Dreamweaver, looked fine in my dreamweaver editor, uploaded it and voila everything goes nuts. List of Problems: The Links are not positioned properly, not big enough plus the drop downs to the bottom and not to the right. That was properly my fault since I just copied a suckerfish method... But can someone help with this. If you study the News Header in the CSS, it says it has a background image, how ever it doesn't show when I uploaded it. I know the url and the pic is correct cause it worked in Dreamweaver... The background for "welcome" is all the way up there which isn't supposed to happen, it supposed to be right on top of the Hello text but that isn't happening either. The hello and welcome are supposed to be aligned to the left of the right header. Thats about it, please can someone help me. I've changed the format of this like 3 times just to get it correctly done, but nothings working. Thank you And don't worry I got it all validated and what not I have a website where I want to make a drop down menu that will bring you to different pages. It is a very basic, sort of old-fashioned website that relies entirely on html. What I'm trying to do is make a drop-down menu that will be used as navigation for a section of a website and I want to have it in each internally linked page in that section, but I'm going to be adding more pages to it over time so I want to be able to put the drop-down menu code in a separate text file and then substitute it into the pages that I make that the options in the menu link to and then just edit the code in the text file when I add another page so that I don't have to go back and edit the code every single individual page whenever I add a new one among them. Basically all I'm asking is how I can put html code in a text file and then substitute that code into an html page by referring to the file. Thanks in advance for any help. Hello! I recently started a blog on the weebly website and I want to convert it over to wordpress. The only problem is that wordpress does not allow javascript, so I was wondering if there is a way to generate an html code without javascript that allows the user to click a button to drop down text. I have a custom script on my current site: http://www.resourceblog.weebly.com It's the short ride button and it allows the user to click on the button in order to drop down a summary of the blog article. Here is the script: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="language" content="english"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <title>Bad Rep</title> <style type="text/css"> #bad { font-family:arial,sans-serif; font-size:12px; color:#ff6600; } #rep { cursor:pointer; } .hidden { display:none; } </style> <script type="text/javascript"> function init(){ var obj=document.getElementById('bad'); obj.className='hidden'; document.getElementById('rep').onclick=function() { obj.className=obj.className=='hidden'?'':'hidden'; } } window.addEventListener? window.addEventListener('load',init,false): window.attachEvent('onload',init); </script> <div> <img id="rep" src="http://i1106.photobucket.com/albums/h365/ResourceMJS/shortride-2.jpg" alt="photobucket"> </div> <ul id="bad"> <li>Recruiters often get a bad reputation because many people do not understand what they do.</li> <li>It is up to the recruiter to build the trust of the candidate by being honest and genuine.</li> <li>Follow up and keep in contact with your candidates so that they continue to hold a strong value in you.</li> </ul> Any help would be appreciated. This forum has answered a lot of my questions and so I love turning to you all for advice Hello! I am creating a blog website using Weebly and am trying to insert a code in which an icon at the top of the blog post drops down a hidden bullet list with a summary of what the article is about. I have one that is working, but it has some flaws that I would like to kink out if possible. Here is the code I have: <meta http-equiv="Content-Type" content="Text/html; charset=iso-8859-1"> <meta name="Content-Script-Type" content="Text/javascript"> <meta name="Content-Style-Type" content="Text/css"> <title>Karma</title> <style type="Text/css"> <!-- .hidden {display:none} --> </style> <div> <img alt="photobucket" onclick="document.getElementById ('karma').className = document.getElementById ('karma').className == 'hidden' ? '' : 'hidden'" src="http://i1106.photobucket.com/albums/h365/ResourceMJS/shortride.jpg"> </div> <ul id="karma"><font style="font-family:arial;color:#FF9900;font-size:12px;"><li>Be yourself when dealing with candidate conversations.</li> <li>Don't lie about your interests to make the conversation flow.</li> <li>Recruiting sometimes causes one to have to toughen up and have difficult conversations.</li></font></ul> The icon does what it is supposed to when clicked, but it has 2 flaws. 1. It doesn't show as clickable. When you mouse over the icon you still get an arrow key instead of the typical button icon. 2. When the page loads, the summary text is already visible and the button collapses it. I want the text to start off hidden and only appear/disappear when the icon is clicked. Is there anyway to solve these? I am kinda of a novice with HTML and coding, so any help would be greatly appreciated. Thank you! Can someone please try and help me with this code. I'm trying to center text below this image with a certain color. Here are the codes and text: Image Code: <style> body div td td {height:700px; vertical-align:top; background-image:url(http://i80.photobucket.com/albums/j1...-2007-14.jpg); background-repeat:no-repeat; background-position:center top;} td.text td, td.text div td td {background-image:none; height:auto;} </style> Color Code: <p style="color:FFFFFF;"> The Text: Many a man curses the rain that falls upon his head, and knows not that it brings abundance to drive away the hunger. Thanks for the help |