HTML - Removing Duplicated Html Code For Reuse?
Hello,
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? Similar TutorialsHi, 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 I have been trying to remove it for the next 2 hours, removing, adding and all kinds of stuff. I don't know where I am going wrong could any of you point me in the right direction please. The image below shows what I want to do. Here is the uploaded template. If you do not wish to download this I can always copy paste the html and post in a comment or PM. http://www.box.net/shared/hiixy2o64r Thanks in advance. Hey guys, completely new here just learning how to do basic html. I'm excited, just hope I don't get lose that as I get futher into it. Anyhow does anyone know what I can remove from this embeded link for a video I uploaded. I uploaded using Yahoo Video, seems to be no limits on time and the quality seem decent enough. I was able to remove a few things that Yahoo put, but I would really like to disable the "I" (info button) and the email button if possible, and the "Big Y" at the top right corner. There was a issue, that when you maxed the video, then hit escape to go back, it would restart the video, and take you to yahoo and replay it. That was not good, I'm glad I found the option to disable the max video. Anyhow here is the code, thank you: <div><object width="512" height="322"><param name="movie" /><param name="allowFullScreen" value="true" /><param name="AllowScriptAccess" VALUE="always" /><param name="bgcolor" value="#000000" /><param name="flashVars" /><embed src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.46" type="application/x-shockwave-flash" width="512" height="322" allowFullScreen="false" AllowScriptAccess="always" bgcolor="#000000" flashVars="id=19390192&vid=7411290&lang=en-us&intl=us&thumbUrl=http%3A//l.yimg.com/a/p/i/bcst/videosearch/14468/106621986.jpeg&embed=1" > Hello everyone. I want to be able to remove the '.html' from the address one of my pages so that instead of potential customers having to type 'laurelscamera.com/photography.html' they can just type 'www.laurelscamera.com/photography'. I have seen this done on other websites, but have no idea how to go about it. Any help would be great. Thanks again. Mitch Hi, I am trying to figure out how to remove the .htm or .html from my pages (other than my index). An example would be http://www.herrickphoto.co.uk/adults.html I'd really like this to be www.herrickphoto.co.uk/adults Any suggestions would really be appreciated. I am using dreamweaver to write the pages and for some reason, some of my pages end in .htm and others in .html Not sure if that's a problem? Thanks for your help! Lynn Hi everyone, This may seem a simple question but here goes... I have two separate domain names, both with different hosting companies. I have uploaded exactly the same page to both servers, but one requires .html after it to view it, and the other doesn't. For example www.########.com/#### www.########.com/####.html Do you know how to change it so it doesn't require the .html at the end to view it? Thanks Tom 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> 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> 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> Hey guys im new to html me and my friend have managed to get a website up and running only that we have a problem with the homepage code it's ok using firefox but when you use chrome or explorer it act's wierd: anyways : heres the website: http://viahacking.altervista.org could someone please fix it?? thanks 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> Hi All... I am having problems with a page...the table displays on one page, but not on another page...and all I've done is c + p from the bad page into the working one and voila! It went bad this is when viewed in Firefox... Here's the page that works...the middle column keeps the text all the way down the page: http://www.ediblog.com/audjblog.htm Here's the page where the table ends, but the text continues down the page: http://www.ediblog.com/rae.htm Can someone tell me what I'm doing wrong here?? wacko.gif I'm very confused... Thanks 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??? 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!! The other day in class, I got this assignment: Identify and correct all of the HTML errors and the poor HTML style in the following HTML document: <html> <title>Name's Broken RIT Home Page</title> <style type="txt/css> body{ background-color: violent; h2{ color:yellow font-family:"Tahoma", sans-serif; } </style> <body> <h2Name's RIT Home Page</h2> <img src="koala baby pic.bmp" alt=Baby Koala /> <p>My introduction (or bio-poem)</p> </hr> <H3>Some of my favorite Web Sites:</H3> www.cocoadev.com<br> www.rit.edu<br /> images.google.com<br /> <h3>Some <strong>communication tools that I use include:</h3></strong> <strong>Smoke Signals</strong><br /> <em>Telepathy</em><br /> <br>Harsh Language</br> <p>Contact me: abc1234@rit.edu</b> <img src="me.jpg"></img> <html> </body> I don't know a single html! Could someone please help? |