Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
|
It's not something you can do in html alone. You generally use a server side scripting language to accomplish what you want. I use php, but you could also use a language like asp or asp.net.
basically the text that you'll want to repeat sits in its own file somewhere and when you want that code to appear you add a line of code to include that file.
You don't need any special code writing program, but you obviously need a little understanding of the server side scripting language, but it's not so deep into the language that it would take long to be comfortable with it.
Ok I kind of lied in my first statement. There is a way you can do this with html alone, but the scripting way really is better. With html alone you could use frames. In this case an iframe is probably easiest. You would put the text you want to repeat in it's own html file and then use code like:
<iframe src="path-to-your-file" width="100%"></iframe>
The width is up to you and your particlular layout, but you'll probably want to use one. Thought I'd see if I could get you to learn a little scripting and there really are issues with using frames so it's generally best to stay away from them.
By the way instead of using just a text editor (which is perfectly fine by the way) might I suggest a code editor. There are many free ones, but they will usually have a few features that make coding easier.
I use HTML Kit and here's a list of free html editors you can try. I've found PSPad to be an easy one to migrate to from a text editor like notepad
|