Templates and Style Sheets
|
|
In order to control the
layout of our page, we use a template.
You can see the buttons and graphics are where we want them. All the links are made. An advantages of using templates are: 1) Consistent Look 2) When you make a change, you only have to do it to
the template. 3) Saves time.
You do not have to keep building the same page over and over
again. Templates can be built
using layers or tables. You can also
have more than one editable region. |
|
|
Typically, when we build a
page, we generate the content in a web page.
|
|
|
Then we apply the template
to the page and put the content into the editable region. We still need to format the text. We would have to make individual changes to the text appearance. Each tag would need to be made on each individual page. For example, if you wanted the entire web site to have arial as it’s font, each page would need to be set to arial. What if there is a way to control the tags within a web page. Well there is. It is called a Cascading Style Sheet or a CSS. |
|
|
What if we wanted all our
content to look like this. You can see that some heading tags have
changed, the font has been changed, the link color, and even a border has
been added. How would we create all
the changes to the pages without having to change each page individually. |
|
|
We create an external file, a style sheet, and attach
it to any page. The styles are then
applied to the tags, sort of like a template.
If we need to make changes, we make changes to the style sheet and all
pages that have the style sheet applied to it will be updated automatically. |
|
|
Once the style sheet is
applied, the page takes on the appearance and the attributes of the styles. If we wanted to change the
font face to Times New Roman, we would do it in the style sheet. We would make changes to the font in the
style sheet and all pages with the sheet applied to it would be changed. Warning: If you make
changes to individual pages, those changes will override the style sheet.
If the page and the style sheet are in conflict for a tag, the page
wins. |
|
|
|