Page 46 - DCAP408_WEB_PROGRAMMING
P. 46
Web Programming
Notes
Example:
< < (for “lower than”)
> > (for “greater than”)
& & (for “ampersand”)
ä ä (for “a umlaut”)
ö, ü ö ü
Ä,Ö,Ü Ä Ö Ü
€ €
© ©
So, for example the German sentence München ist eine schöne Stadt! will display as:
München ist eine schöne Stadt!
2.1.8 Formatting text with Attributes
Attributes can be used to change a tag’s properties. For example, a paragraph’s property might
be its alignment (left, right or center). A text’s property might be its font size or color.
To change these properties, tags can be extended by attributes:
<p style=”text-align:center”> a centered paragraph </p>
<p style=”text-align:right”> a paragraph aligned right </p>
The paragraph tag “p” here has the attribute “style”, and the attribute is assigned a value,
namely “text-align:center” (or “text-align:right”).
This particular attribute “style” is our first example of CSS (Cascading Style Sheets) technology.
Style sheets allow you to specify the presentation (look) or your text. We will learn more about
CSS later.
In older HTML documents, you may also see the attribute “align”,
For example:
<p align=”center”> another centered paragraph </p>.
This still works in HTML, but is deprecated, i.e. you are not supposed to use this attribute anymore.
Example:
<html>
<body>
<p><b>This text is bold</b></p>
<p><strong>This text is strong</strong></p>
<p><big>This text is big</big></p>
<p><i>This text is italic</i></p>
<p><em>This text is emphasized</em></p>
<p><code>This is computer output</code></p>
40 LOVELY PROFESSIONAL UNIVERSITY