Attributes

Key terms and abbreviation are used for most text properties. However some properties need more information like aligning text

An example of this is justifying text. You need to say whether the text is going to be left, right or centred. To be able to do this you need to use text attributes.



This text has been justified to the left

Left

To justify a paragraph to the left the HTML code is:- <p align="left"> Text you want justified to the left </p>



This text has been centred using the align centre tagged

Center

To centre align a paragraph the HTML code is:- <p align="center"> Text you want centred goes here </p>



This text has been justified to the right

Right

To justify a paragraph to the right the HTML code is:- <p align="right"> Text you want justified to the right </p>



The paragraph tag is not the only tag to have attributes. The horizontal tag also has attributes, these are width and size are the two attributes. Width is clear, it controls how far across the page the line goes, and size controls how think the line should be.


Horizontal lines

The code below shows a horizontal line which takes up 75% of the page and has a thickness of 3.

<hr width="75%" size="3"/>


If you don't specify a size of the horizontal line then the default size is 2.





This is the end of this section, you can continue to the next section or try the exam to test your knowledge.
Click here to attempt the exam now.


Previous Page

Next Page

Go to top