HTML codes
Started by
MaLing
, Sep 18 2006 05:04 AM
7 replies to this topic
#1
Posted 18 September 2006 - 05:04 AM
I have some questions about HTML codes, and hope that somebody could kindly help.
1) I want to display some words on the top, bottom and centre (vertically) respectively on a web page, what html codes should I use?
2) I want to add an email address link on the page, does this work?
<a href=mailto:someone@some.where> my mail address </a>
3) How to change the colour of the above mail address link on the page from blue to another?
All answers are very welcome
1) I want to display some words on the top, bottom and centre (vertically) respectively on a web page, what html codes should I use?
2) I want to add an email address link on the page, does this work?
<a href=mailto:someone@some.where> my mail address </a>
3) How to change the colour of the above mail address link on the page from blue to another?
All answers are very welcome
#2
Posted 18 September 2006 - 06:51 AM
1) Quick and dirty way with inline styles:
<html>
<body>
<span style="position: absolute; top: 0;">Top</span>
<span style="position: absolute; top: 50%;">Middle</span>
<span style="position: absolute; top: 97%;">Bottom</span>
<body>
</html>
Last value is less than 100% as you have to take in account for the tool / status bars etc. You can also do this with tables, however you have to becareful as not all browsers support table heights.
2) <a href="mailto:someone@some.where">someone@some.where</a>
3) <a href="mailto:someone@some.where" style="color: Red">someone@some.where</a>
Changes it to Red. You can use #FF0000 (R-FF G-00 B-00). All 0's are Black, all F's are White.
Alternatively you can apply a class from a style block or sheet. The one above is an inline style.
<html>
<body>
<span style="position: absolute; top: 0;">Top</span>
<span style="position: absolute; top: 50%;">Middle</span>
<span style="position: absolute; top: 97%;">Bottom</span>
<body>
</html>
Last value is less than 100% as you have to take in account for the tool / status bars etc. You can also do this with tables, however you have to becareful as not all browsers support table heights.
2) <a href="mailto:someone@some.where">someone@some.where</a>
3) <a href="mailto:someone@some.where" style="color: Red">someone@some.where</a>
Changes it to Red. You can use #FF0000 (R-FF G-00 B-00). All 0's are Black, all F's are White.
Alternatively you can apply a class from a style block or sheet. The one above is an inline style.
#3
Posted 18 September 2006 - 11:10 PM
Thank you Zamiel, those work.
In the code:
<span style="position: absolute; top: 97%;">Bottom</span>
instead of reserving a small percentage for the bottom margin, can I use 'bottom: 0%' to replace 'top: 97%'? That is to say:
<span style="position: absolute; bottom: 0%;">Bottom</span>
In the code:
<span style="position: absolute; top: 97%;">Bottom</span>
instead of reserving a small percentage for the bottom margin, can I use 'bottom: 0%' to replace 'top: 97%'? That is to say:
<span style="position: absolute; bottom: 0%;">Bottom</span>
#4
Posted 18 September 2006 - 11:39 PM
You may find "Bottom" has a few issues in some browsers but if you're doing it for something like IE then all will be fine.
#5
Posted 19 September 2006 - 04:46 AM
Oh I see. How about 'left' and 'right'? Do they create problems?
#6
Posted 19 September 2006 - 05:10 AM
I tend to use Top and Left mainly as Right and Bottom were both supported later in the browser lifecycle.
That is Top and Left are supposedly supported in IE4+, FF1+, NS4+ whereas Right and bottom are from IE5+, FF1+, NS6+.
That is Top and Left are supposedly supported in IE4+, FF1+, NS4+ whereas Right and bottom are from IE5+, FF1+, NS6+.
#7
Posted 19 September 2006 - 07:42 AM
These are very informative. Zamiel, thank you very much for your help.
#8
Posted 19 September 2006 - 01:50 PM
No probs. Tiz what I do
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users