View HTML Source Code

While checking a web page, you might want to see the HTML code behind it. Here we will see how you can view HTML source code for the entire page or a specific element.

1. View HTML Source Code of Entire Page

  • To view the source code of a webpage press ctrl + u on the page, or right-click on the page and select the “view page source” option.
  • This will open a new tab that shows the HTML source code for that entire page.

2. Inspect an HTML Element on a Page

  • To check the HTML code for a specific element on a page, right-click on the page and select the “Inspect” option.
  • This lets you see the HTML and CSS behind that element. You can also try making changes and see the changes.

HTML Basics

HTML stands for Hyper Text Markup Language. It is the standard markup language for creating Websites. It is used to describe the structure of a Web page. HTML consists of elements that tell the browser how the content is displayed on the screen. We’ll walk you through fundamental HTML examples and teach you how to create a webpage. This HTML Basics covers fundamental HTML examples.

In this guide, the basics of HTML include learning HTML tags ( <h1>, <p>, <img>, etc), attributes, elements, and document structure which collectively form a working web page.

Table of Content

  • Basic HTML Document
  • HTML Headings
  • HTML Paragraph and Break Elements
  • HTML Horizontal Line
  • HTML Images
  • View HTML Source Code

Similar Reads

Basic HTML Document

Every HTML document begins with a document type declaration, setting the foundation for the webpage. This section introduces basic HTML tags that structure the page, such as , , and . Although this is not mandatory, it is a good convention to start the document with the below-mentioned tag.... </p> </a> </div> <div class="article-related-item"> <a href="/article/learn_html_basic_structure_2"> <p class="article-related-title"> HTML Basic Structure:</p> <p class="article-related-description"> HTML Structure... </p> </a> </div> <div class="article-related-item"> <a href="/article/learn_html_headings_3"> <p class="article-related-title"> HTML Headings</p> <p class="article-related-description"> The HTML heading tags are used to create headings for the content of a webpage. These tags are typically placed inside the body tag. HTML offers six heading tags, from <h1> to <h6>, each displaying the heading in a different font size.... </p> </a> </div> <div class="article-related-item"> <a href="/article/learn_html_paragraph_and_break_elements_4"> <p class="article-related-title"> HTML Paragraph and Break Elements</p> <p class="article-related-description"> HTML <p> tags are used to write paragraph statements on a webpage. They start with the <p> tag and end with </p>. The HTML <br> tag is used to insert a single line break and does not require a closing tag. In HTML, the break tag is written as <br>.... </p> </a> </div> <div class="article-related-item"> <a href="/article/learn_html_horizontal_line_5"> <p class="article-related-title"> HTML Horizontal Line</p> <p class="article-related-description"> The HTML <hr> tag is used to divide a page into sections by creating a horizontal line that spans from the left to the right side of the page. This is an empty tag and does not require a closing tag or any additional attributes.... </p> </a> </div> <div class="article-related-item"> <a href="/article/learn_html_images_6"> <p class="article-related-title"> HTML Images</p> <p class="article-related-description"> The <img> tag is used to insert an image into a webpage. The source of the image is specified within the src attribute, like this: <img src=”source_of_image”>.... </p> </a> </div> <div class="article-related-item"> <a href="/article/learn_view_html_source_code_7"> <p class="article-related-title"> View HTML Source Code</p> <p class="article-related-description"> While checking a web page, you might want to see the HTML code behind it. Here we will see how you can view HTML source code for the entire page or a specific element.... </p> </a> </div> <div class="article-related-item"> <a href="/article/learn_faqs_–_html_basics_8"> <p class="article-related-title"> FAQs – HTML Basics</p> <p class="article-related-description"> What are the basics of HTML?... </p> </a> </div> </div> </div> </div> <div class="detail-right"> <div class="box"> <h4>Categories</h3> <div class="cats"> <a href="/html/default" class="cats_item" title="HTML Tutorial">HTML</a> <a href="/css3/default" class="cats_item" title="CSS3 Tutorial">CSS3</a> <a href="/bootstrap/default" class="cats_item" title="Bootstrap Tutorial">Bootstrap</a> <a href="/foundation/default" class="cats_item" title="Foundation Tutorial">Foundation</a> <a href="/sass/default" class="cats_item" title="Sass Tutorial">Sass</a> <a href="/js/default" class="cats_item" title="JavaScript Tutorial">JavaScript</a> <a href="/typescript/index" class="cats_item" title="TypeScript Tutorial">TypeScript</a> <a href="/jquery/default" class="cats_item" title="JQuery Tutorial">JQuery</a> <a href="/angularjs/default" class="cats_item" title="AngularJS Tutorial">AngularJS</a> <a href="/react/default" class="cats_item" title="React Tutorial">React</a> <a href="/nodejs/default" class="cats_item" title="NodeJS Tutorial">NodeJS</a> <a href="/highcharts/default" class="cats_item" title="Highcharts Tutorial">Highcharts</a> <a href="/php/default" class="cats_item" title="PHP Tutorial">PHP</a> <a href="/python/default" class="cats_item" title="Python based tutorial">Python</a> <a href="/python3/default" class="cats_item" title="Python3 tutorial">Python3</a> <a href="/django/index" class="cats_item" title="Django tutorial">Django</a> <a href="/linux/default" class="cats_item" title="Linux tutorial">Linux</a> <a href="/docker/default" class="cats_item" title="Docker tutorial">Docker</a> <a href="/ruby/default" class="cats_item" title="Ruby tutorial">Ruby</a> <a href="/java/default" class="cats_item" title="Java tutorial">Java</a> <a href="/cprogramming/default" class="cats_item" title="C tutorial">C</a> <a href="/cplusplus/default" class="cats_item" title="C ++ tutorial">C ++</a> <a href="/perl/default" class="cats_item" title="Perl tutorial">Perl</a> <a href="/servlet/default" class="cats_item" title="Servlet tutorial">Servlet</a> <a href="/jsp/default" class="cats_item" title="JSP tutorial">JSP</a> <a href="/lua/default" class="cats_item" title="Lua tutorial">Lua</a> <a href="/scala/default" class="cats_item" title="Scala tutorial">Scala</a> <a href="/go/index" class="cats_item" title="Go tutorial">Go</a> <a href="/asp/default" class="cats_item" title="ASP tutorial">ASP</a> <a href="/csharp/default" class="cats_item" title="C # tutorial">C #</a> <a href="/sql/default" class="cats_item" title="SQL Tutorial">SQL</a> <a href="/mysql/default" class="cats_item" title="MySQL Tutorial">MySQL</a> <a href="/sqlite/default" class="cats_item" title="SQLite Tutorial">SQLite</a> <a href="/mongodb/default" class="cats_item" title="MongoDB Tutorial">MongoDB</a> <a href="/redis/default" class="cats_item" title="Redis Tutorial">Redis</a> <a href="/android/default" class="cats_item" title="Android Tutorial">Android</a> <a href="/swift/default" class="cats_item" title="Swift Tutorial">Swift</a> <a href="/ionic/default" class="cats_item" title="ionic Tutorial">ionic</a> <a href="/kotlin/index" class="cats_item" title="kotlin Tutorial">Kotlin</a> <a href="/xml/default" class="cats_item" title="XML Tutorial">XML tutorial</a> </div> </div> <div class="box"> <h4>Contact US</h4> <div class="form-group" style="height:36px"> <label for="inputEmail3" class="col-sm-3 control-label">Email:</label> <div class="col-sm-9"> <input type="email" class="form-control" id="inputEmail3" placeholder="Email"> </div> </div> <div class="form-group"> <label for="inputPassword3" class="col-sm-3 control-label">Content:</label> <div class="col-sm-9"> <textarea class="form-control" rows="3" id="inputTextarea" placeholder="Please Enter"></textarea> </div> </div> <div class="form-group"> <div class="col-sm-offset-3 col-sm-9"> <button class="btn btn-default" onclick="toSubmit()" style="margin-top:15px">Submit</button> </div> </div> </div> <div class="box outside"> <a href="/article/learn_capwap_data_in_split_mac_architecture_5"></a> <a href="/article/learn_applications_of_dso_3"></a> <a href="/article/learn_what_is_stomach_1"></a> <a href="/article/learn_id_(iterative_dichotomiser_)_6"></a> <a href="/article/learn_converting_verbs_to_abstract_nouns_9"></a> <a href="/article/learn_conclusion_–_dengue_mosquito_and_normal_mosquito_5"></a> <a href="/article/learn_how_to_solve_error_xe_2"></a> <a href="/article/learn_how_to_check_various_menu_structures_of_the_sap_ewm_system_4"></a> <a href="/article/learn_best_practices_for_balancing_creativity_and_usability_in_uiux_design_3"></a> <a href="/article/learn_top_gre_accepting_universities_in_the_usa_2"></a> </div> </div> </div> </div> <script src="/public/js/jquery.min.js"></script> <script src="/public/js/bootstrap.min.js"></script> <script> $(function() { var ref = document.referrer; var data = ref ? ref.split('//')[1].split('/')[0].replace(/\./g, '-') : 'other'; $.post("/analysis", { referrer: data }); }); function toSubmit() { var email = $('#inputEmail3').val() var contact = $('#inputTextarea').val(); if (email.length > 5 && contact.length > 1) { $.ajax({ url: '/contact', // 目标URL type: 'POST', // 请求类型 data: { email: email, contact: contact }, success: function(res) { // 请求成功时的回调函数 console.log(res); if (res == true) { $('#inputEmail3').val('') $('#inputTextarea').val('') } }, error: function(xhr, status, error) { // 请求失败时的回调函数 console.error(error); } }); } }; </script> </body> </html>