Building Android Apps with HTML, CSS, and JavaScript, 2nd Edition
by Jonathan Stark, Brian Jepson, Brian MacDonald
Web Programming Crash Course
The three main technologies we will use to build web apps are HTML, CSS, and JavaScript. We’ll quickly cover each to make sure we’re all on the same page before plowing into the fancy stuff.
Introduction to HTML
When you are browsing the web, the pages you are viewing are just text documents sitting on someone else’s computer. The text in a typical web page is wrapped in HTML tags, which tell your browser about the structure of the document. With this information, the browser can decide how to display the information in a way that makes sense.
Consider the web page snippet shown in Example 1-1. On the first line, the string Hi there! is wrapped in a
pair of h1 tags. Notice that the
open tag and the close tag are
slightly different: the close tag has a slash (/) as the second
character, while the open tag does not have a slash.
Wrapping text in h1 tags tells the browser that the words
enclosed are a heading, which will cause it to be displayed in large
bold text on its own line. There are also h2, h3,
h4, h5, and h6
heading tags. The lower the number, the more important the header, so
text wrapped in an h6 tag will be
smaller (i.e., less important-looking) than text wrapped in an h3 tag.
After the h1 tag in Example 1-1, there are two lines wrapped in p tags. These are called paragraph tags. Browsers will display each paragraph on its own line. If the paragraph is long enough to exceed the width of the browser window, the text will bump down and continue on ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access