Computer Science

HTML Code

HTML code, short for HyperText Markup Language, is a standard language used to create and design web pages. It consists of a series of elements, tags, and attributes that define the structure and content of a webpage. HTML code is essential for building websites and is often used in conjunction with other web technologies like CSS and JavaScript.

Written by Perlego with AI-assistance

12 Key excerpts on "HTML Code"

  • Book cover image for: Web Marketing for the Music Business
    • Tom Hutchison(Author)
    • 2013(Publication Date)
    • Routledge
      (Publisher)

    Chapter 6

    HTML and Scripts

    HTML: THE BASICS AND WHY YOU NEED THEM

    Hypertext markup language (HTML) is the predominant authoring language for the creation of web pages. HTML defines the structure and layout of a web document by using a variety of tags and attributes to denote formatting of certain text as headings, paragraphs, and lists. HTML is written in the form of tags bracketed by the greater than and less than symbols, such as <tag>. Most tags come in pairs, the opening tag is listed as <tag>, and the closing tag is </tag>, which denotes the end of the previous command. For example, if you wanted to italicize a word in a sentence, you would precede the word with the tag for italics <i> and follow the word with the end tag </i>. Failure to include the end tag would result in everything from that point forward being presented in italics. A web visitor’s browser examines the HTML for instructions on how to display the graphics, text, and other multimedia components. Tutorials can be found at www.w3schools.com .
    When someone types in a URL or clicks on a web page link, the browser requests a document from a web server via the hypertext transport protocol, or HTTP. The server then sends the document back to the user, which is displayed on the browser. The things that are contained in the document (text, photos, audio and video files, etc.) were all put there using HTML structure.
    Most web design programs will allow the novice to build a web site without any knowledge of HTML language, but a basic understanding of HTML Code can come in handy for tweaking web pages and widgets. For example, YouTube now provides options for designing how embedded videos will look on your site—you can select the border color, adjust the size of the thumbnail, and adjust the size of the video window, within limits (see Chapter 8
  • Book cover image for: JavaScript for Modern Web Development
    eBook - ePub

    JavaScript for Modern Web Development

    Building a Web Application Using HTML, CSS, and JavaScript

    • Alok Ranjan, Alok Ranjan, Abhilasha Sinha, Ranjit Battewad(Authors)
    • 2020(Publication Date)
    • BPB Publications
      (Publisher)
    HAPTER 2

    HTML - Creating the Web Content

    “Content is king.” ~ Bill Gates
    H aving gone through the brief history of the web and JavaScript and how it has grown over the years, we will start our journey of modern web development right from the basics.
    In this chapter, we will learn about the first and most important foundation pillar of web development—HTML (HYPERTEXT MARKUP LANGUAGE).
    HTML is actually not a programming language, but it is a markup language. Markup languages are designed for the definition, presentation, and processing of text. It specifies the format of the code. The code is designed in such a way that it is syntactically distinguishable. HTML is the language of the web that web browsers use to compose text, audio, images, videos, graphics, and other materials into rich web pages.

    Structure

    • Getting started with HTML
    • Building blocks of HTML
    • Structure of an HTML document
    • Different HTML elements

    Objective

    At the end of this chapter, you will be able to learn about the features of HTML and how to use HTML to put your content in the form of basic web pages.

    Getting started with HTML

    HTML Code is plain text which can be saved with .html or .htm extension and opened with the browser. The following code is how a basic HTML Code looks like: <!DOCTYPE html> <html> <head> <title>My First HTML</title> </head> <body> <h1>Hello World!</h1> <h2>Welcome to learning HTML!</h2> <p>Welcome to Web Development!</p> </body> </html> You can write the preceding code snippet in a simple notepad, but we will eventually need a specialized code editor as we progress in our web development, so now is the time to select an editor. There are many editors available and you can choose whichever you are comfortable with. Here is a popular list to choose from:
  • Book cover image for: Introduction to Data Technologies
    In Section 2.2, we will emphasize the idea that computer languages have strict rules that must be followed. Computer code must be exactly correct before it can be used to control the computer. The specific rules for HTML Code are introduced in this section. Section 2.3 addresses the issue of what computer code means . What in-structions do we have to use in order to make the computer do what we want? This section looks in a bit more detail at some examples of HTML Code and shows how each piece of code relates to a specific feature of the resulting web page. Section 2.4 looks at the practical aspects of writing computer code. We will discuss the software that should be used for writing code and emphasize the importance of writing tidy and well-organized code. Sections 2.5 and 2.6 look at getting our computer code to work properly. Sections 2.5 focuses on the task of checking that computer code is correct— that it follows the rules of the computer language—and Section 2.6 focuses on how to run computer code. We will look at some tools for checking that HTML Code is correct and we will briefly discuss the software that produces web pages from HTML Code. We will also discuss the process of fixing Writing Computer Code 11 problems when they occur. Section 2.7 introduces some more ideas about how to organize code and work efficiently. The Cascading Style Sheets language is introduced to provide some simple demonstrations. 2.1 Case study: Point Nemo (continued) Figure 2.1 shows a simple web page that contains a very brief statistical report on the Poles of Inaccessibility data from Chapter 1. The report con-sists of paragraphs of text and an image (a plot), with different formatting applied to various parts of the text. The report heading is bold and larger than the other text, and the table of numerical summaries is displayed with a monospace font.
  • Book cover image for: Introduction to HTML & XML (Markup Languages)
    ____________________ WORLD TECHNOLOGIES ____________________ Chapter 1 HTML HTML (HyperText Markup Language) Filename extension .html, .htm Internet media type text/html Type code TEXT Uniform Type Identifier public.html Developed by World Wide Web Consortium & WHATWG Type of format Markup language Extended from SGML ____________________ WORLD TECHNOLOGIES ____________________ Extended to XHTML Standard(s) ISO/IEC 15445 W3C HTML 4.01 W3C HTML 5 (draft) HTML , which stands for HyperText Markup Language , is the predominant markup language for web pages. A markup language is a set of markup tags, and HTML uses markup tags to describe web pages. HTML is written in the form of HTML elements consisting of tags surrounded by angle brackets (like ) within the web page content. HTML tags normally come in pairs like and . The first tag in a pair is the start tag , the second tag is the end tag (they are also called opening tags and closing tags ). The purpose of a web browser is to read HTML documents and display them as web pages. The browser does not display the HTML tags, but uses the tags to interpret the content of the page. HTML elements form the building blocks of all websites. HTML allows images and objects to be embedded and can be used to create interactive forms. It provides a means to create structured documents by denoting structural semantics for text such as headings, paragraphs, lists, links, quotes and other items. It can embed scripts in languages such as JavaScript which affect the behavior of HTML webpages. HTML can also be used to include Cascading Style Sheets (CSS) to define the appearance and layout of text and other material. The W3C, maintainer of both HTML and CSS standards, encourages the use of CSS over explicit presentational markup. History The historic logo made by the W3C.
  • Book cover image for: Teaching Computational Thinking and Coding in Primary Schools
    • David Morris, Gurmit Uppal, David Wells, Author(Authors)
    • 2017(Publication Date)
    • Learning Matters
      (Publisher)
    6    
    Coding with HTML and Web Design
    Learning outcomes By the end of this chapter you will:
    •    have developed an understanding of the rationale for teaching children to code with HTML; •    understand the role of coding and web design in the primary computing curriculum and how these can be used to engage children at different stages of learning; •    know how to code with HTML yourself and identify how to teach this knowledge to children; •    identify potential opportunities to integrate coding and web design with learning across the curriculum.
    Teachers’ Standards
    A teacher must:
    2.    Promote good progress and outcomes by pupils:
    •    be aware of pupils’ capabilities and their prior knowledge, and plan teaching to build on these.
    3.    Demonstrate good subject and curriculum knowledge:
    •    have a secure knowledge of the relevant subject(s) and curriculum areas, foster and maintain pupils’ interest in the subject, and address misunderstandings.
    4.    Plan and teach well-structured lessons:
    •    contribute to the design and provision of an engaging curriculum. (DfE, 2011)
    Introduction
    Most web pages that you will come across are written in a language called HTML (Hypertext Markup Language). Although other scripts and codes may also be used, HTML provides the basic skeleton upon which the web page hangs. It is important at this stage to point out that HTML is not a programming language, but what is known in computing terms as a markup language. The concept of ‘markup’ originates from the traditional editorial process where paper manuscripts were annotated with written instructions for revisions, and so in this sense, HTML is a system for ‘marking up’ or identifying the components of a web page. This invariably involves things such as headings, paragraphs, pictures and lists as well as the features and attributes of these items such as font size, colour and alignment which determine how the web page looks in a browser. HTML is not immediately visible and lies behind the page you see, but knowing how to code with HTML basically allows you get ‘under the bonnet’ and control or change the way things look.
  • Book cover image for: Technical Communication & its Applications
    ____________________ WORLD TECHNOLOGIES ____________________ Chapter 11 HTML : Web Language HTML (HyperText Markup Language) Filename extension .html, .htm Internet media type text/html Type code TEXT Uniform Type Identifier public.html Developed by World Wide Web Consortium & WHATWG Type of format Markup language Extended from SGML ____________________ WORLD TECHNOLOGIES ____________________ Extended to XHTML Standard(s) ISO/IEC 15445 W3C HTML 4.01 W3C HTML 5 (draft) HTML , which stands for HyperText Markup Language , is the predominant markup language for web pages. A markup language is a set of markup tags, and HTML uses markup tags to describe web pages. HTML is written in the form of HTML elements consisting of tags surrounded by angle brackets (like ) within the web page content. HTML tags normally come in pairs like and . The first tag in a pair is the start tag , the second tag is the end tag (they are also called opening tags and closing tags ). The purpose of a web browser is to read HTML documents and display them as web pages. The browser does not display the HTML tags, but uses the tags to interpret the content of the page. HTML elements form the building blocks of all websites. HTML allows images and objects to be embedded and can be used to create interactive forms. It provides a means to create structured documents by denoting structural semantics for text such as headings, paragraphs, lists, links, quotes and other items. It can embed scripts in languages such as JavaScript which affect the behavior of HTML webpages. HTML can also be used to include Cascading Style Sheets (CSS) to define the appearance and layout of text and other material. The W3C, maintainer of both HTML and CSS standards, encourages the use of CSS over explicit presentational markup. History The historic logo made by the W3C.
  • Book cover image for: Beginning Programming All-in-One For Dummies
    • Wallace Wang(Author)
    • 2022(Publication Date)
    • For Dummies
      (Publisher)
    5 Web Programming Contents at a Glance CHAPTER 1: HyperText Markup Language 471 CHAPTER 2: CSS 487 CHAPTER 3: JavaScript 495 CHAPTER 4: PHP 509 CHAPTER 5: Ruby 523 CHAPTER 1 HyperText Markup Language 471 HyperText Markup Language T he language used to create every web page in the world is HyperText Markup Language (HTML). Although you can create web pages with specialized web page editing programs, such as Adobe Dreamweaver, it’s still nice to know how HTML works so you can modify web pages manually or create unique effects that may be difficult or impossible to accomplish with a web page editing program. Similar to the way a traditional programming language relies on keywords, HTML relies on tags (keywords) that follow a rigidly defined syntax. Instead of creating a working program like a traditional programming language, HTML creates web pages that browsers can view. In a traditional programming language, an error or bug can keep the entire program from running or make it calculate incorrectly. In HTML, an error can keep a web page from appearing or just make the web page display incorrectly. If you’re interested in understanding the heart of web page design, you need to understand the basics of using HTML. Chapter 1 IN THIS CHAPTER » Defining a web page » Putting in graphics » Defining your background » Creating hyperlinks with anchor points » Setting your tables 472 BOOK 5 Web Programming The Structure of an HTML Document The basic HTML tag defines the entire HTML document like this: Anything between the and tags will appear on the web page. The last tag uses a forward slash (/) to identify the end of the tag. Generally, HTML tags work in pairs — the first tag defines something, and the second tag (the one beginning with a forward slash) marks the end of that defi- nition. If you omit one of the or tags, your HTML web page won’t appear.
  • Book cover image for: Foundations of Data and Digital Journalism
    • Alex Richards(Author)
    • 2023(Publication Date)
    • Routledge
      (Publisher)
    hypertext part of the name describes individual online documents—webpages—threaded together through “hyperlinks”—though today, we’d be more inclined to simply call them “links” instead. Rather than having to thumb through an index to locate and then visit a separate piece of content, a one-way leap could be directly established, like a doorway linking one document to another.
    Ultimately, these hyperlinks between webpages act as the individual connections that make up the World Wide Web, a major component of the internet. They’re significant enough that the terms “web” and “internet” are used almost interchangeably today.
    As a markup language, HTML defines the structure and holds the content of a document, which can include text and references to image files and other digital media, as well as semantic information that gives important cues about what the content represents.
    More importantly, though, a markup language like HTML works together with another language called CSS, which describes how all content should be displayed. These instructions include the visual flourishes—color, dimensions, size, position, and more.
    The concept of a markup language isn’t unique to the internet or the web, and you encounter them in more places than you might think. They keep your Microsoft Word files formatted properly and can feed content to the mobile apps on your phone.
    HTML is no different; it’s just meant to be interpreted and shown by a web browser, like Apple Safari or Google Chrome.
    Figure 10.1 The homepage of the Flatwater Free Press, a nonprofit newsroom based in Omaha, Nebraska.
    So, writing or revising an HTML document goes beyond just the content itself—you’re also writing the instruction manual for the look, feel, and overall experience of a webpage.

    What you need to create HTML

    Before you do anything with HTML, you’ll need the right setup. Just as you needed spreadsheet software like Google Sheets to rearrange and summarize data, you need a place not only to write HTML and CSS, but also to render that code and display it properly. That includes two non-negotiable elements: A text editor
  • Book cover image for: Web Programming
    eBook - PDF

    Web Programming

    Building Internet Applications

    • Chris Bates(Author)
    • 2014(Publication Date)
    • Wiley
      (Publisher)
    PART I HTML 2 Hypertext Markup Language 2.1 BASIC HTML Websites are often powerful and complex applications yet they are based upon such a simple and straightforward markup language that almost anyone with a moderate amount of knowledge can produce them. The principle which underpins HTML is to take some structured content, usually a mixture of text and images, and then add formatting instructions to it. The Web browser uses that formatting information to correctly process the content. The processing may take the form of display on the screen, sending it to a printer or reading the page aloud to a visually impaired user. That is just like word processing really, the big difference being that we can directly edit the formatting information in situ. In a word processor, formatting is done using binary control codes which are not legible to, or suitable for editing by, humans. The formatting codes within a Web page are all written in plain text. One of the most important features of Web documents is that they contain hyperlinks which let readers navigate to other documents. Again these are entered as simple plain text. All of the complex processing needed to locate, download and display the linked page is performed transparently by the browser. In this chapter I will show you how to write standard HTML to create well-structured Web pages which can be linked to build rich and enjoyable Websites. The most primitive Web pages contain just text, possibly with a few hyperlinks. You will still see sites around the Web which are formatted just as pages were in the mid 1990s. These sites are often trying to impart information and their developers regard presentation as a secondary attribute. I think of such markup as basic HTML – the sort of thing that we were writing before the Web became interactive and multimedia. I will describe some of the 18 2. Hypertext Markup Language more visual parts of HTML later but let us start off by learning about the simplest types of Web page.
  • Book cover image for: Web Engineering
    No longer available |Learn more
    Thirteen of these elements still exist in HTML 4. HTML is a markup language that web browsers use to interpret and compose text, images and other material into visual or audible web pages. Default characteristics for every item of HTML markup are defined in the browser, and these characteristics can be altered or enhanced by the web page designer's additional use of CSS. Many of the text elements are found in the 1988 ISO technical report TR 9537 Techniques for using SGML , which in turn covers the features of early text formatting languages such as that used by the RUNOFF command developed in the early 1960s for the CTSS (Compatible Time-Sharing System) operating system: these formatting commands were derived from the commands used by typesetters to manually format documents. However, the SGML concept of generalized markup is based on elements (nested annotated ranges with attributes) rather than merely print effects, with also the separation of structure and processing; HTML has been progressively moved in this direction with CSS. Berners-Lee considered HTML to be an application of SGML. It was formally defined as such by the Internet Engineering Task Force (IETF) with the mid-1993 publication of the first proposal for an HTML specification: Hypertext Markup Language (HTML) Internet-Draft by Berners-Lee and Dan Connolly, which included an SGML Document Type Definition to define the grammar. The draft expired after six months, but was notable for its acknowledgment of the NCSA Mosaic browser's custom tag for embedding in-line images, reflecting the IETF's philosophy of basing standards on successful prototypes. Similarly, Dave Raggett's competing Internet-Draft, HTML+ (Hypertext Markup Format), from late 1993, suggested standardizing already-implemented features like tables and fill-out forms.
  • Book cover image for: Beginning HTML5 and CSS3 For Dummies
    • Ed Tittel, Chris Minnick(Authors)
    • 2013(Publication Date)
    • For Dummies
      (Publisher)
    The best way to start working with HTML is to jump right in, so that’s what this chapter does: It explains the basics of how HTML and CSS work behind the scenes inside web pages, and it introduces you to their underlying building blocks. When you’re done with this chapter, you’ll know how HTML and CSS work so you can start creating or editing web pages right away — albeit very, very simple ones. 10 Part I: Getting Started with HTML and CSS on the Web How and Where Web Pages Come to Life Online Web pages can accommodate many kinds of content, such as text, graphics, forms, audio and video files, streaming media, and even interactive games. Browse the web for only a moment or two, and you see a smorgasbord of information and content displayed in many ways. Every website is different, but all have one thing in common: HyperText Markup Language (also known as HTML). You also run into Cascading Style Sheets (CSS) regularly. Regardless of what information a web page contains, every page is cre-ated using some form of HTML. HTML is the mortar that holds web pages together: graphics, text, and other information are the bricks. CSS tells web pages how they should look (and to some extent, behave) when on display. HTML files that produce web pages are simple text files, whether those files contain HTML4, HTML5, or even XHTML. Same thing goes for CSS. Reliance on simple text files, or documents, explains why the web works as well as it does. Text is a universal way of representing data for computers. Any text file you create on a Windows PC — including any HTML or CSS file — works equally well on a Mac, Linux/Unix, or any other operating system. But web pages aren’t merely text documents. Web pages are made using special, attention-starved, sugar-loaded text called HTML or CSS.
  • Book cover image for: Electronic Commerce
    The Web browser would display the text as: A Review of the Book HTML Is Fun! Some Web browsers allow the user to customize the interpretations of the tags so that different Web browsers might display the tagged text differently. For example, one Web browser might display text enclosed by strong tags in a blue color instead of displaying the text as bold. Tags are generally written in lowercase letters; however, older versions of HTML allowed the use of either case and you might still see Web pages that include uppercase (or mixed case) HTML tags. Although most tags are two-sided (they require both an opening and a closing tag), some require only an opening tag and are known as one-sided tags. The tag that creates a line break (
    ) is a common one-sided tag. Some tags, such as the paragraph tag (

    ), are two-sided tags for which the closing tag is optional. Designers sometimes omit the optional closing tags, but this practice is poor markup style. Some opening tags contain one or more property modifiers that further refine how the tag operates. A tag’s property might modify a text display, or it might designate where to find a graphic element. Figure 2-6 (on the next page) shows some sample text marked up with HTML tags and Figure 2-7 (on page 81) shows this text as it appears in a Web browser. The tags in these two figures are among the most common HTML tags in use today on the Web. Other frequently used HTML tags (not shown in the figures) let Web designers include graphics on Web pages and format text in the form of tables. Online sources (such as the W3C Getting Started with HTML page) and textbooks are available to help you learn more about HTML. HTML LINKS The Web organizes interlinked pages of information residing on sites around the world. Hyperlinks on Web pages form a “web” of those pages. A user can traverse the interwoven pages by clicking hyperlinked text on one page to move to another page in the web of pages.
Index pages curate the most relevant extracts from our library of academic textbooks. They’ve been created using an in-house natural language model (NLM), each adding context and meaning to key research topics.