Back to the index| Previous | Next
The text in our web page can be mark out, by dividing it in paragraphs, giving headers to the sections or emphasizing some words or periods with appropriate tags.
| Code | Output |
| <b> Hello </b> to everybody!!! |
Hello to everybody!!! |
| This is a simple text (not formatted) | This is a simple text (not formatted) |
| <b> This is a bold text </b> | This is a bold text |
| Code | Output |
| <i> Hello </i> to everybody!!! |
Hello to everybody!!! |
| This is a simple text (not formatted) | This is a simple text (not formatted) |
| <i> This is a italic text </i> | This is a italic text |
| <b;><i> This is a bold and italic text </i></b> | This is a bold and italic text |
| Code | Output |
| What is the output of this <br /> tag? | What is the output of this tag? |
| What is the output of this <hr /> tag? | What is the output of this tag? |
The tag p marks off a section of text like a paragraph, by inserting a new line at the beginning and at the end of the paragraph.
| Code | Output |
| Simple text. <p> This is a paragraph. It doesn't need the tag br! </p> |
Simple text. This is a paragraph. It doesn't need the tag br! |
These tags mark off a text as a header of first, second, third .. level
| Code | Output |
| <h1> 1 </h1> | Header 1 |
| <h2> Header 2 </h2> | Header 2 |
| <h3> Header 3 </h3> | Header 3 |
We can assign a personal style to the p, h1, h2 ... tags or to the whole body too.
A good practice is to separate the page style from its contents:
the information about the page layout can be inserted in the
STYLE tag.
This tag can be setted in the HEAD section.
| <head> <style>.. </style> </head> |
In the STYLE tag, we must specify the selector, that's to say the element we want to assign to a personal style (the paragraph p, the header h1, the whole body...), then we have to specify (between curly brackets) some properties and their respective values.
| Some property | Values |
| font-size | large, medium, small, x-small... |
| font-family | Arial, Verdana, Times New Roman.... |
| text-align | left, right, center |
The sintax (CSS sintax) is: selector {property:value; property:value;.... }
An exemple| <head> <style> h1 {font-size:large; font-family:Arial; text-align:center; } p {font-size:x-small; font-family:Arial; text-align:left; } </style> </head> |