|
Free
computer Tutorials
|
![]() |
HOME
|
Stay at Home and Learn | ||||
|
Cascading Style Sheets Adding a Stlye to your HTML |
|||||
|
Adding a Border around text
We'll now use the Editor to add a border around a paragraph of text. This will demonstrate how to use the ID Selectors. So create a new web page. Add a paragraph or two of text. Again, it's a two step process to set up and apply an ID selector. So once you have your paragraphs of text, do this:
Step One - Setting up the ID Selector
The Border Width and Border Colour are self-explanatory. The Border Padding is the space between the text and the Border. Set all three values to anything you like. When you're done, click OK. The following code will be added to the HEAD section of your web page: <HEAD> <STYLE> Note the name of the ID Selector - Borders. The Hash symbol (#) in front of it is enough to set up an ID selector.
Step Two - Applying the ID SelectorTo apply the ID selector you have just set up, do this:
<Div ID = Borders>
A paragraph of text. A paragraph of text. A paragraph
of text. A paragraph of text. A paragraph of text. A paragraph of text.
A paragraph of text. A paragraph of text. A paragraph of text. A paragraph
of text. A paragraph of text. A paragraph of text. A paragraph of text.
A paragraph of text. A paragraph of text. A paragraph of text. A paragraph
of text. A paragraph of text. A paragraph of text. A paragraph of text.
A paragraph of text.
In the next part, we'll see how to set up page margins. <-- Back One Page Move on to the Next Part --> <--Back to the Style Sheets Contents Page View all our Home Study Computer Courses
|