HTML - Reuse Of Html Code
Hi,
I am new to this forum and to Html. I am building a static page for my friend, and my interest in html and css is purely non commercial. So please bear with my ignorance. I used a open source CSS template to design this website. Right now I have ten pages. Each page has navigation bars on the left, a block on the right with some quote, a banner on top, a foot note at the bottom and a central content. Now for each of these ten pages, I had to copy and paste the left, right, top, bottom blocks. Is there a shorter way of doing this? I mean, can I use a command like include, that includes the code lines from an external file, so that I don't have to worry about editing in each and every page. For example, I have this line "last edited on 10th Dec 08" in the right block in each of the page. If I edit the page today, I have to change this sentence, in each of the pages. I know content management system is a solution. But my hosted space doesn't allow dynamic pages. Could someone suggest a way? Thank you Prapanj Similar TutorialsHello, This question is probably been asked so many times but i still do not understand it so i'm going to ask again if it's already been asked in forums already. I've got a website with many pages where the homepage has many links. e.g. home.html, about.html, contact.html etc... The navigation structure of these pages are the same hence while i'm coding it, i ended up copy/pasting same code across all pages in order to establish the navigation structure. Additionally, i have a copyright section (at the bottom of page) which i include in all pages. Problem is how can i write my code to have it this structure but not allowing duplicate code. Without duplicate code i can reuse code in future. .................................................................................................... ........................ I've heard people suggesting using php includes but that would mean my site turning into php (server side stuff). Is there another method? I clearly do not want to go down the php route (as requested by my client, his own web server does not support server side technologies, kinda weird but its their internal thing & my job is just to design the site and this is what i've been told) So preferably if it can be avodied i would avoid into php. Therefore i am asking is there a way that can be done with simple html or even javascript perhaps? My html problem keeps failling, with all my image codes.. shown for 10 errors which are all for the images what's wrong? Here is the code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- New Perspectives on HTML and XHTML 5th Edition Tutorial 2 Case 2 Fiddler Home Page Author: Date: 2-16-2011 Filename: home.htm Supporting files: fiddler.jpg --> <title>, ITSE 1411 Lab Project 2, Tutorial 2 Case 2, Due 02/23/2011</title> </head> <body> <div> <img src="fiddler.jpg" alt="Fiddler on the Roof" /> <hr /> <a href="home2.htm"><img src="home.jpg" alt="home" /></a> <a href="slide1txt.htm"<img src="start.jpg" alt="start" /></a> <a href="slide1txt.htm"<img src="back.jpg" alt="back" /></a> <a href="slide2txt.htm"<img src="forward.jpg" alt="forward" /></a> <a href="slide6txt.htm"<img src="end.jpg" alt="end" /></a> <br /> <a href="slide1txt.htm"<img src="thumb1.jpg" alt="slide1" style="border-width: 5" /></a> <a href="slide2txt.htm"<img src="thumb2.jpg" alt="slide2" style="border-width: 0" /></a> <a href="slide3txt.htm"<img src="thumb3.jpg" alt="slide3" style="border-width: 0" /></a> <a href="slide4txt.htm"<img src="thumb4.jpg" alt="slide4" style="border-width: 0" /></a> <a href="slide5txt.htm"<img src="thumb5.jpg" alt="slide5" style="border-width: 0" /></a> <a href="slide6txt.htm"<img src="thumb6.jpg" alt="slide6" style="border-width: 0" /></a> </div> <hr /> <div> <img src="slide1.jpg" alt="slide1" /> </div> <blockquote> <p><i>Do You Love Me?</i> sung by Deb Ingalls and Thomas Gates</p> </blockquote> </body> </html> Hello! I have a blog on blogger and i want to make a c++ tutorial.. But every time i type "<iostream>" on post, when i see it, it is only "iostream". How can i make a code like the "[code]" from BBcode to cancel the compiling from HTML? Thanx! Hello everybody, I'm new here. I'm redesigning my own website and came up with some tricky situation. I write HTML lessons and I want to put just the pure code in my posts, but they appear as a regular html document... How do I make the code to be shown just as text (code), like we do in the forum boards (code tags or whatever)? 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. Dear Forum-goers, If I knew what to search for I would, but I don't know what this idea is called. I want to create a website with code that does the following: <body> (INSERT FROM OTHER HTML FILE: Page introduction) (INSERT FROM OTHER HTML FILE: Content) (INSERT FROM OTHER HTML FILE: Sidebar) </body> Is there a way to do this? If not, then okay. I've tried using <link />, which doesn't do the job. You'll see the line in question in blue font: 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" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>This is the main page.</title> <link type="text/css" rel="stylesheet" href="journal.css" /> </head> <body> <link type="text/html" rel="content" href="tobelinked.html" /> </body> </html> Hello fellow HTMLer's! I have a serious eye problem-- i am per-assumming-- because I can't figure out what is wrong with my code; When I use my function dart to draw the specs on my table, it seems to do nothing, but I keep scanning my code and I can't figure out what is wrong with it. Any help would be awesome. Thank you! P.S Why haven't the X/HTML gods created an compiler yet, or I'm I out of date! HTML Code: <html> <head> <style> table {border-collapse:collapse} </style> <script> nx=32; ny=32; wx=1000; wy=600; dx=Math.floor(wx/nx); ny=Math.round(nx*600/1000); function dart() {npt=200; for(i=0;i<npt;i++) {x=Math.floor(Math.random()*nx); y=MAth.floor(Math.random()*ny); r=Math.floor(Math.random()*256); g=Math.floor(Math.random()*256); b=Math.floor(Math.random()*256); id1=x+","+y; b1=document.getElementById(id1); b1.style.backgroundColor="rgb("+r+","+g+","+b+")"; } } function getid(id3) {document.form1.idextract.value=id3; comma=id3.indexof(","); x1=id3.substring(0,comma); y1=id3.substring(comma+1, id3.length); document.form1.xextract.value=x1; document.form1.yextract.value=y1; colorstring=document.getElementById(id3).style.backgroundColor; lparen=colorstring.indexof("("); // rgb ( = l paren , = comma1 g , = comma2 b ) comma1=colorstring.indexof(","); comma2=colorstring.indexof(",",comma1+1); r1=colorstring.substring(lparen+1,comma1); //rgb( r,g,b ) you could be a four instead of lparen g1=colorstring.substring(comma1+3,comma2); b1=colorstring.substring(comma2+3,colorstring.length-1); document.form1.rextract.value=r1; document.form1.gextract.value=g1; document.form1.bextract.value=b1; } </script> </head> <body> <table> <script> dy=dx; for(i=0;i<ny;i++) {document.write("<tr>"); for(j=0;j<nx;j++) {color="yellow"; id1=j+","+i; document.write( "<td id="+id1+" style='background-color:"+color+ ";width:"+dx+";height:"+dy+"' onclick='getid(\""+id1+"\")'></td>"); } document.write("</tr>"); } </script> </table> <form name="form1"> id extracted<input type="text" value="id" name="idextract"/input> x extracted<input type="text" value="x" name="xextract"/input> y extracted<input type="text" value="y" name="yextract"/input> <br> r <input type="text" value="r" name="rextract"/input> <br> g <input type="text" value="g" name="gextract"/input> <br> b <input type="text" value="b" name="bextract"/input> <br> <input type="button" value="dart" onclick="dart()"/input> </form> </body> </html> Hello Im some what knew to HTML and im trying to make a Resume for a class, but Im having a little trouble. Im trying to center some headings in my table, but it doesn't seem to work. Also now the education part is next to the headings. <html> <head> <title>Resume - John</title> </head> <body style="background:#B45F04"> <p style="text-align: center;"><b><h2>Resume - John</h2></b></p> <br> <table border="0" width="600" cellpadding="45" cellspacing="45"> <p style="text-align: center;"> <tr> <TH ALIGN=Center Rowspan=2><p><a href="#Ed">Education</a></p></th> <TH ALIGN=Center Rowspan=2><p><a href="#Exp">Experience</a></p></th> <TH ALIGN=Center Rowspan=2><p><a href="#Tal">Talents</a></p></th> <TH ALIGN=Center Rowspan=2><p><a href="#Ref">References</a></p></th> </tr> <td><a name="Ed"><h3>Education</h3></a></td> <td>Table Cell</td> </tr> <tr> <td><a name="Exp"><h3>Experience</h3></a></td> <td>Table Cell</td> </tr> <tr> <td><a name="Tal"><h3>Talents</h3></a></td> <td>Table Cell</td> </tr> <tr> <td><a name="Ref"><h3>References</h3></a></td> <td>Table Cell</td> </tr> </table> <p style="font-family:verdana,arial,sans-serif;font-size:10px;"></p> </body> </html> I am trying to bold and make the text in this phrase orange: Get 20% Off On ALL Home Improvement Projects!! Deal Ends April 30th! See html below <marquee behavior="scroll" direction="left">Get 20% Off On ALL Home Improvement Projects!! Deal Ends April 30th!</marquee> <p style="font-size:10px;"><a href="http://facebook.com/homeimprovementexperts/">Click Here To Get Weekly Deal Updates</a></p> Hi Guyz... visit this site www.mobiusservices.com I would like to know how effective and good are the HTML codes for Search Engine Optimization. I am a Marketing Guy i understand only the nitty-gritty of HTML. I'd feel great if you can help me out in pointing out some errors and some good technique for Search Engine Ranking. Note: This site is still under testing phase. Extensive work is going on to improve the site. here is a code i made for one of my sponsers this one has 16 errors showing. dosnt like the affiliate code or anything else. please do not laugh at my crude work but i am learning. thanks again. so far i have been trying different options and keep making things worse </script><center> <a href="http://www.bikeberry.com/index.php?ref=2&cPath=30&affiliate_banner_id=1 "target="_blank"> <img src="http://motorbicycling.com/images/misc/bbb.gif"> </center> </a> Hi everyone! I am new to this forum and would like to ask some questions(if thats ok!). I'll only ask 1 on this thread. How do I make a form in HTML that would be HTML Code: <INPUT TYPE="input" NAME="from">Your Email Address<P> <INPUT TYPE="input" NAME="firstname">Your First Name<P> <INPUT TYPE="input" NAME="lastname">Your Last Name<P> <INPUT TYPE="input" NAME="subject">Subject<P> <INPUT TYPE="submit" VALUE="Submit"> but how would I have the "submit" button automaticly email me the information. When i do it (with a few modifications to the code) it always open up Thunderbird (my email program) and just gives them like a Mailto Link to my email... any help?? Thanks in advance!! Does anyone know if this code has any kind of SEO benefit or what it's relevance is? Thanks in advance! Code: td class="botLinkText" <td class="botLinkText"><a href="http://www.blahblah.com/pages/page.asp" class="botLink">keywords & description</a></td> Hi there,,, I've built my site using web builder app... now I want to make a signup page for my web users... How can I do this??? Is there any HTML code for this, which I can embed to my web page??? Any helps??? Hello! Im new to html/css and need some help. This is my website: πολυόργανα. I want to set as backround a jpg image (1100px width) in the top of the white area. This is the code: body#bd { backround: none repeat scroll 0 0 #FFFFFF color: #333333; } Can anyone write the new HTML code for me please Thanks in advance Dear All, I have just joined this forum and need help. I am a complete novice on using html. I have created a couple of web pages using a website which provides free web design software. The website is called http://www.wix.com/ I would like to be able to use the html code for specific pages in order to embed it somewhere external for example like a fanpage in facebook. However wix.com does not allow this functionality and therefore does not provide embed codes which work. However I managed to get this html code but it does not seem to work on my fanpage. What do i need to change in the code to make it work? I would really appreciate any help someone can give me on this. Thank you so much in advance <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Create & Design free website and Flash Web Content.</title> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <!-- apu7.wixpress.com --> <meta name="keywords" content="Edit free website, create free websites, design myspace layouts"/> <meta name="Description" content="Create free website , Edit & customize free Flash MySpace layouts at Wix.com. It's free, takes minutes to design & publish, and is as simple as making presentation slide."/> <img src="http://frog.wix.com/load_log?origin=EditorLoadStates&extra_msg=HTMLstarted&appOpGuid=cafe3587-c6d5-4293-8e25-d1db123b1662×tamp=0" width="0" height="0" style="display:none;" /> <script type="text/javascript"> var loadingLogEnabled = true; //${loadingLogEnabled} var staticServerUrl = "http://static.wix.com/"; var editingSessionGuid = "cafe3587-c6d5-4293-8e25-d1db123b1662"; var usersDomain = "users.wix.com"; var wixDocId = "${pageId}"; var sFlashVars = "pageId=${pageId}&userId=GUhZv_;if94-a&newTemplate=false&partner_id=WMGs4POB1ko-a&gu_id=116c93d4-8d5b-4ac9-bb8f-7ef3d32e485b&experiment_id=empty&session_expired=true&editor_app_srv_subdomain=editor&abtest=${edito rAbTestValue}&newLogin=true&editorVer=1"; var usersDomain = "users.wix.com"; </script> <style type="text/css"> html, body { margin: 0; padding: 0; width: 100%; height: 100% } body { overflow: hidden; } </style> <script type="text/javascript" src="http://static.wix.com/client/js/editor.js?v=500"></script> <script type="text/javascript" src="http://static.wix.com/client/js/userApi_v1.js?v=500"></script> <script type="text/javascript" src="http://static.wix.com/client/js/swfobject.js?v=500"></script> <script type="text/javascript" src="http://static.wix.com/client/js/facebook.js?v=500"></script> <script type="text/javascript"> window.onload = function() { var timestamp var url; url = "http://frog.wix.com/load_log?origin=EditorLoadStates&extra_msg=jsOnPageLoad&"; var arr = []; if (typeof isFirstEditorSession != "undefined") arr.push("firstEditorSession=" + isFirstEditorSession()); if (typeof swfobject != "undefined") arr.push("additional_info=" + encodeURIComponent(swfobject)); if (typeof description != "getAppOpGuid") arr.push("appOpGuid=" + getAppOpGuid()); if (typeof wixDocId != "undefined") arr.push("parentDocId=" + wixDocId); if(APP_TIMESTAMPS.length > 0){ timestamp = (new Date().getTime() - APP_TIMESTAMPS["appLoading"]); }else{ timestamp = 0; } arr.push("timestamp=" + timestamp); arr.push("originIsTemplate=0"); arr.push("user=" + (typeof userServer == "undefined" ? "" : userServer.getEmail())); new Image(0, 0).src = url + arr.join("&"); } </script> </head> <body onBeforeunload="return exitWin();return false;"> <div id="flashContent"></div> <script type="text/javascript"> //<![CDATA[ var minimalFlashVersion = "10.0.0"; if (swfobject.hasFlashPlayerVersion(minimalFlashVersion)) { var flashvars = {}; var params = { play: "true", loop: "true", menu: "true", quality: "high", scale: "noScale", salign: "tl", wmode: "window", bgcolor: "#ffffff", base: "http://static.wix.com/", flashvars: "siteId=65bad1a6-444e-1033-af9e-16e97b4422bc&userId=GUhZv_;if94-a&newTemplate=false&partner_id=WMGs4POB1ko-a&gu_id=116c93d4-8d5b-4ac9-bb8f-7ef3d32e485b&experiment_id=empty&session_expired=true&editor_app_srv_subdomain=editor&abtest=${edito rAbTestValue}&newLogin=true&editorVer=2", allowscriptaccess: "always", allowfullscreen: "true" }; var attributes = { id: "app", name: "app", align: "middle" }; try { swfobject.embedSWF("http://static.wix.com/client/WixEditorApp.swf?v=500&max-age=172800", "flashContent", "100%", "100%", minimalFlashVersion, false, flashvars, params, attributes); } catch(e) { logError("EDITOR", "flashNotCreated", e.message, "65bad1a6-444e-1033-af9e-16e97b4422bc", "GUhZv_;if94-a", "siteId=65bad1a6-444e-1033-af9e-16e97b4422bc&userId=GUhZv_;if94-a&newTemplate=false&partner_id=WMGs4POB1ko-a&gu_id=116c93d4-8d5b-4ac9-bb8f-7ef3d32e485b&experiment_id=empty&session_expired=true&editor_app_srv_subdomain=editor&abtest=${edito rAbTestValue}&newLogin=true"); } } else { window.location.href = "http://static.wix.com/client/noFlash.html"; } //]]> </script> <div id="fb-root"></div> <script type="text/javascript"> //<![CDATA[ window.fbAsyncInit = function() { FB.init({appId: FB_APP_ID, status: true, cookie: true, xfbml: true}); }; (function() { var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; document.getElementById('fb-root').appendChild(e); }()); //]]> </script> <script type="text/javascript" src="http://www.google-analytics.com/ga.js"></script> <script type="text/javascript"> //<![CDATA[ var pageTracker = _gat._getTracker("UA-2117194-1"); pageTracker._initData(); pageTracker._trackPageview(); //]]> </script> <img src="http://frog.wix.com/load_log?origin=EditorLoadStates&extra_msg=HTMLend&appOpGuid=cafe3587-c6d5-4293-8e25-d1db123b1662×tamp=0" width="0" height="0" style="display:none;" /> </body> </html> I use reporting services alot, and all the code in that is XML, but i want to use a refresh code that is html, how could i do this? or is it possible If you have blog or web take this widget hip hop code: <!-- WidgetldWidget49cb96c83adf1 Embed Code --> <span id="ldWidget49cb96c83adf1" > Loading <a href="http://www.widgetavenue.com/wdg/loaders/stn.php?alias=url_WidgetAvenue49cb96c8282a0"> widget</a> </span> <script type="text/javascript"> var script = document.createElement("script"); var t = new Date(); script.setAttribute('src','http://www.widgetavenue.com/wdg/loaders/bad_js.php?alias=url_WidgetAvenue49cb96c8282a0&_installid_=ldWidget49cb96c83adf1&_nocache_='+ t.getTime()); destNodeDiv = document.getElementById('ldWidget49cb96c83adf1'); destNodeDiv.parentNode.insertBefore(script, destNodeDiv); </script> <!-- end WidgetAvenue Widget --> take a loot at my template. i need help with the glitch. hover your mouse below the template need payment,about us etc. please help http://fortressht@lowpricehighdef.co...00Aaabbbb.html |