Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML tag to prevent HTML tags to be executed?

Tags:

html

xhtml

Basic question which I thought of asking on Superuser, but it is a programming question I think. I just started learning HTML, so please bear with me.

How can I prevent a program from interpreting an HTML tag / syntax? For example, I want to write a flash card like this:

The html code for < is &lt;

I would like a solution that would work for any or most syntax, not just for <.

How can I enter the syntax (without any space) to make sure the code isn't interpreted?

like image 407
JDelage Avatar asked Oct 09 '09 11:10

JDelage


1 Answers

This:

The html code for &lt; is &amp;lt;

Renders as:

The html code for < is &lt;

The basic strategy is to escape the & as &amp;

like image 114
Daniel Martin Avatar answered Oct 18 '22 02:10

Daniel Martin