0

I have a page on which i have to show some HTMl code. That code is not of that same HTML page but is something other.

How can i do that. Is there a way for that? Something like here on stackoverflow if we click code button and indent 4 spaces we can write code which displays as it is. How to do that??

Actual code which i want to display:

<!--Modal design for 7th Form Try popup modal-->
        <div id="tallModal7" class="modal modal-wide fade">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">Registration Form</h4>
                    </div>
                    <div class="modal-body">
                        <form action = "#" method = "get">
                            <div class="has-success">
                            <label for = "name">Name:</label>
                            <input type="text"  class="form-control" placeholder="Enter your Full Name" id = "name"  required>
                            </div><br>
                            <div class="has-success">
                            <label for = "dob">DOB:</label>
                            <input type="date"   class="form-control" placeholder="DOB" id = "dob"  required>
                            </div><br>
                            <label for = "email">Email ID:</label>
                            <div class="has-success">
                            <input type="email" class="form-control" placeholder="Enter your Email" id = "email" required>
                            </div><br>
                            <label for = "city">City:</label>
                            <div class="has-success" >
                            <input type="text"  class="form-control" placeholder="Enter your city name" id = "city" required>
                            </div><br>
                            <label for = "contact">Contact Number:</label>
                            <div class="has-success" >
                            <input type="number"  class="form-control" placeholder="Enter your contact number"  id = "contact" required>
                            </div><br>
                        </form>
                    <div class="modal-footer">
                        <button type = "submit" class="btn btn-primary" onclick = "thankyou()" data-dismiss = "modal">Submit</button>
                        <button type = "reset" data-dismiss = "modal" class="btn btn-primary">Close</button>
                    </div>

                    </div>
                </div>
                <!-- /.modal-content -->
            </div>
            <!-- /.modal-dialog -->
        </div>
        <!-- /.modal -->
        <!--It ends here-->
amphetamachine
  • 27,620
  • 12
  • 60
  • 72
  • http://stackoverflow.com/questions/9320112/is-there-a-plugin-to-display-html-code-inside-my-web-page?rq=1 – Paulie_D Mar 06 '15 at 11:23

1 Answers1

0

You can replace the opening and ending tags with their respective html char code and then wrap it within 'pre' and 'code' tags.

You can replace:

& with &amp;
< with &lt;
> with &gt;
AndrewL64
  • 15,794
  • 8
  • 47
  • 79