Page 44 - DCAP408_WEB_PROGRAMMING
P. 44
Web Programming
Notes 3. Open the file by browsing it
4. Get the output
2.1.3 Text Structures
As we have seen, a line break in your source file does not mean that there will be a line break on
the web page displayed by your browser. So how do you structure the text on your page? For
example, how do you get headings that are set apart from the text underneath? And how do you
start a new paragraph that is set off by a blank line from your previous text?
2.1.4 Headings
Heading structures are most commonly used to set apart document or section titles.
There are six levels of headings, from heading 1 through heading 6. Heading1 (h1) is “most
important” and heading 6 (h6) is “least important.” By default, browsers will display the six
heading levels in the same font, with the point size decreasing as the importance of the heading
decreases. Here are two examples:
<h1>Heading 1: The largest</h1>
<h6>Heading 6: The smallest</h6>
2.1.5 Paragraphs and Line Breaks
To create an empty line between two blocks of text, you need to label those text blocks (or
paragraphs) with the paragraph marker “p”. So, surround your paragraphs with <p> and </
p> like we have done in our example page. Actually, in HTML you do not need the closing tag
for “p”, you can create an empty line after a block by just writing <p>. Here is an example
(note that you do not actually need to leave a blank line between the two paragraphs in your
source code).
<p>This is the first paragraph. Isn´t it a nice paragraph? It has lots of words in it. It´s such a nice
paragraph that I think it should never end.</p>
<p>This is the second paragraph. It´s also a very nice paragraph
but maybe not as nice as that first one was.</p>
If you just want to move down to the next line, without leaving a blank space, you would use a
“br”, for line break. For example, like this
This is a line.<br> And here is the next line.
Example: Given below is another example for using line break in your web page.
<html>
<body>
<p>This is<br />a para<br />graph with line breaks</p>
</body>
</html>
38 LOVELY PROFESSIONAL UNIVERSITY