Message # 1 | 2:50 PM
Fonts commonly used for website - HTML:

The problem with fonts on the internet is, if you choose one that your visitors don't have installed on their computer, your text will display in their browsers default font. Since different fonts often take up different amounts of space this can make a real mess of your carefully designed web page, so it's generally a good idea to stick to the basic fonts which come pre-installed on most computers. Here's the list:

Quote
<font face="Times">uCoz support forum</font>

<font face="Geneva">uCoz support forum</font>

<font face="Courier">uCoz support forum</font>

<font face="Arial">uCoz support forum</font>

<font face="Optima">uCoz support forum</font>

<font face="Impact">uCoz support forum</font>


It's also worth noting that you can specify more than one font, so that if the user doesn't have the first font on the list, the browser will go through it in order until it finds one that they do, for instance:

Quote

<font face="Arial, Verdana, Trebuchet MS, Sans">Some Text</font>

The above tag would make the browser try to render the text first in Arial, then Verdana, then Trebuchet MS, and finally if none of those fonts are available, any sans serif font it can find.

Note: Sans Serif fonts are the ones like Arial and Verdana, which don't have fancy bits on the end of the letters. Times and Georgia are Serif fonts (with fancy bits).


How to set the Font color - HTML

Color (always spelled the American way) can be set using the colors name, or its Hex code.

Browsers recognize an increasing number of color names, such as aqua, gray, lime and maroon. You can find a full list of widely recognized color names [ Here]

Hex codes are a fully supported version of color names. Every shade of every color imaginable has a hex code. It's a 6 character code started with a # sign, for instance #ffffff is the hex code for white, and #000000 is black. You can find a pretty long list of hex codes on [ Here ].

Quote

<font color="red">Here's how to set font color by name</font>

<font color="#ff0000">Here's how to set font color with a hex code.</font>


You may have heard of "Web safe" colors. In the bad old days, when the majority of computers struggled to show more than 256 colors, the web safe hexadecimal color chart was invented. It consisted of 216 colors that these systems could display cleanly. However, with the advent of modern technology, it's probably no longer necessary to take such precautions, since most computers can now display millions of colors.


How to change the Font Size - HTML

Font size can be One to Seven. (Note: If you set your font with CSS you can use pt or px sizes, which allows you to be a lot more precise).

Quote
<font size="1">Some size 1 text</font>

<font size="4">Some size 4 text</font>

<font size="6">Some size 6 text</font>




How to combine Font Tags - HTML

You can combine font face, size and color in the same tag.

Quote

<font color="red" size="1" face="Courier"> Some size 1 red Courier text</font>

<font face="Times" size="4">Some size 4 Times text</font>




How to set Font style - HTML

Quote
<i>Some Italic Text</i>

<b>Some Bold Text</b>

<u>Some Underlined Text</u>

<strike>Some Strike Out Text</strike>

<div align="center">

Some Centered Text
</div>



How to create Scrolling Marquees - HTML

You can use marquees to make text or images scroll.
Note: Marquees are not valid HTML 4.1, but they do still work in most browsers.

Quote
<marquee>Default marquees scroll left...</marquee>

<marquee behavior="scroll" direction="right">But you can make them scroll right by adding a direction</marquee>

<marquee behavior="scroll" direction="up">Up and Down work too!</marquee>

Marquees have other behaviors
Note: You may have to refresh the page to see the slide marquee, and Firefox doesn't support it (it scrolls instead).

Quote
<marquee behavior="slide">Sliding Marquee*</marquee>

<marquee behavior="alternate">Alternate Marquees Kind of Bounce</marquee>

You can change the speed using scroll amount

Quote
<marquee scrollamount="4">Scrollamount 4</marquee>

<marquee scrollamount="20">Scrollamount 20</marquee>

<marquee scrollamount="8">Scrollamount 8</marquee>

Scrolldelay lets you make your marquees pause

Quote
<marquee scrolldelay="500" scrollamount="100">Scrolldelay 500</marquee>

Finally, you can get creative with your marquees, to get cool effects like this.
Note: Browsers other than IE, Firefox and Opera may struggle with marquees within marquees.

Quote
<marquee direction="up" behavior="alternate">
<marquee direction="right" behavior="alternate">
Bouncy Bouncy Text...*</marquee></marquee>



How to create a List - HTML

HTML supports 2 different types of lists. Unordered lists are the ones that have some kind of bullet point. The types are


  • Square
  • Disc
  • Circle

and the code for writing an unordered list is

Quote
<ul type="square">
<li> Item 1
<li> Item 2
<li> Item 3
</ul>

Secondly, there's ordered lists. These are the ones with letters, numbers, or roman numerals before the items. For a numbered list, type="1". For letters, type="a" or "A" (big letters). If you want numerals, then type should be "I". Finally if you want to start your numbered list from the middle, just set the type to the number you want to start from, eg, type="5".

The ordered list code is pretty similar to unordered. Just replace "ul" with "ol"

Quote
<ol type="a">
<li> Item 1
<li> Item 2
<li> Item 3
</ol>


How to make my text linkable - HTML

Here is the code to make your text click able.
Note: Links on Vampire freaks must always be FULL (i.e include the http:// bit)

Quote

<a href="http://www.forum.ucoz.com/forum/"> Your Click able Text Here </a>

If you want your link to open in a new window, just add target="_blank" into the link tag, eg:

Quote

<a href="http://www.forum.ucoz.com/forum/" target="_blank"> Click able Text </a>

Added (2009-12-20, 8:50 Am)
---------------------------------------------


How to edit text using CSS

As well as coloring individual bits of text, CSS also allows you to style large blocks of text, or bits you don't have direct control over, so cant wrap font tags around, like peoples comments on your profile.

HTML tags know which bit of text you want to edit because you wrap them around it. Similarly with CSS you have to identify the text you want to affect. Let's say you want to affect all of the text on your profile page. You should apply your styles to body (which means page body, or the entire page). Here's how:

Quote
<style type="text/css">
body { color: red; }
</style>

Most of the time you're going to want to edit more than one property of your text at once, and CSS makes this easy- you can just list the properties you want to change one after the other, like this:

Quote
<style type="text/css">
body {
color: red;
font-family: "Times New Roman", Times, serif;
font-size: 14px;
font-weight: bold;
font-style: italic;
text-decoration: underline;
letter-spacing: 5px;
font-variant: small-caps;
}
</style>



How to edit text in a certain table

So what about getting more specific, and just editing text in a certain table? Well, every table on the VF page has something called a class. This is a sort of id by which CSS can refer to it. You can find a full list of the classes for all the tables on the Profile Page section of this site, but for now let's use the comments table as an example. The comments table has the class "comments" (big surprise there). In CSS classes are always preceded by a dot, so that the browser realises its a class, so when we want to apply styles to the comments table, we use ".comments" like this:

Quote
<style type="text/css">
.comments {
color: red;
font-family: "Times New Roman", Times, serif;
}
</style>

As with the page body, you can apply as many styles as you like, one after the other, but these ones will only affect the text in your comments table.


Individual Bits of Text

Normally you would probably use the span tag for applying styles to individual bits of text, since that's pretty much what its designed for. On your profile page the span tag is allowed and this works fine. You could style an individual bit of text like this:

Quote

normal text <span style="color: lime; font-size: 14px;"> some lime 14px text </span> and back to normal

However, if you want to make colored comments, either on peoples profiles, or on the message boards, you'll find the HTML is filtered more carefully, and the span tag is not allowed. This isn't really a problem, because you can apply styles to any tag you like. P (paragraph tag) might be a good one, since this is allowed both on the boards and in comments. Here is how it would work.

Quote

<p style="color: lime; font-size: 14px;"> some lime 14px text </p>

One small problem with this- if you're a perfectionist, you'll notice that the p tag includes an automatic line break- so you get a bit of a gap between the text above and your colored paragraph. To fix this, you can just set the paragraph margin to zero.

Quote

<p style="color: lime; font-size: 14px; margin: 0px;"> some lime 14px text </p>



Mouseover Links - CSS)

CSS is great for messing with your text links, because you can edit the styles of unvisited, visited, and hoverlinks separately (and so make them change color when the mouse hovers over them). There is actually a fourth link state, called "active" which is how the link looks when it has just been pressed, but since this only shows for a millisecond before the browser moves off to wherever the link leads, I'm going to skip it in this tutorial.

So let's take a look at the other link states.

Quote
<style type="text/css">
a:link { color: maroon; }
a:visited { color: deeppink; }
a:hover { color: teal; }
</style>

If you haven't clicked a "top" link yet, it should be maroon (default unvisited link color). Finally, when you hover over it, it should change to teal (the hover color). Pretty simple, right?

Of course you can do things to your links other than change the colors. How about making it grow massive, and have a bright red background on hover.

Quote
<style type="text/css">
a:link { color: maroon; font-size: 10px; }
a:visited { color: deeppink; font-size: 10px; }
a:hover { color: teal; background: red; font-size: 16px; }
</style>

As you can see, you can set as many properties as you like for each of the different link states.


Changing Links in Specific Tables

If you want to change the links in a specific table on your uCoz page or any other page, for instance, make only the links in your leftnav table red, you would just use the appropriate class in front of each link state you want to change, for example, this code would make all of your leftnavs maroon when unvisited, deeppink when visited, and teal on hover, like the ones above:

Quote
<style type="text/css">
a:link { color: maroon; }
a:visited { color: deeppink; }
a:hover { color: teal; }
</style>



CSS Text Properties - Color with CSS

Quote
color: deeppink;

color: lime;

color: #ff0000;

color: #00ccff;




Font Family (with CSS)

Quote
font-family: Arial, Helvetica, sans-serif;

font-family: 'Times New Roman', Times, serif;

font-family: 'Courier New', Courier, mono;

font-family: Georgia, 'Times New Roman', Times, serif;

font-family: Verdana, Arial, Helvetica, sans-serif;

font-family: Geneva, Arial, Helvetica, sans-serif;




Font Size (with CSS)

Setting font size with CSS is a little different to HTML, because you have the benefit of a whole range of different measurements. px (pixels) and pt (point) are the ones your probably going to want to use. They're a nice simple, fairly static measurements. The key difference between them is that px sizes change depending on the users screen resolution. Pt maintains its size regardless of screen res.

Quote
font-size: 10px;
font-size: 12px;
font-size: 14px;
font-size: 10pt;
font-size: 12pt;
font-size: 14pt;



Background Color (with CSS) (links only)

For links, CSS has the option to set a background color just for the text.(nb you can't do this with plain text, as the equivalent style is used to set page background). You can set background color using color names or hex codes.

Quote

background-color: orange;

background-color: #9999CC;

background-color: #990000;




Font Weight (with CSS)

Font weight is for making text bolder or lighter. Values include bold, bolder, light, and 100 (thin text), 200 (thicker), etc. upto 900. In small fonts the difference is negligible.

Quote
font-weight: bold;

font-weight: bolder;

font-weight: lighter;

font-weight: 400; (400 is equivalent to normal text. Can also be "normal").

font-weight: 900;




Font Style (with CSS)
Quote

font-style: italic;

font-style: oblique; (no it's not a mistake. Oblique text does look err.. rather like italic).




Text Decoration (with CSS)

Quote
text-decoration: none; (can be used to erase the underline from links)

text-decoration: underline;

text-decoration: overline;

text-decoration: underline overline;

text-decoration: line-through;

text-decoration: blink; (Supported by Firefox, Netscape & Opera)

Added (2009-12-20, 8:50 Am)
---------------------------------------------


Font Variant (with CSS)

Quote
font-variant: Small-Caps;



Letter Spacing (with CSS)
Quote
letter-spacing: 5px;

letter-spacing: 2px;

letter-spacing: 10px;




Opacity / Transparency

This code works in IE*, Firefox and newer versions of Opera. It may work in other browsers too, but these are the ones I've tested. If you want the text to fade in or out, you can use the [ IE fade ] filter, but that won't work in any browsers other than Internet Explorer. Opacity (in case your wondering) is simply the opposite to transparency. 100% Opaque is completely visible, while 100% transparent is completely invisible. Anyhow, on with the filters. Lets write over an image so you can see whats happening.

And here is the code.

Quote
<font style="width: 200px; height: 20px; filter: alpha(opacity=50);-moz-opacity:.50;opacity:.50;">
This code would produce 50% opacity!
</font>

Note: Opacity works on images too.


Glow / Shadow / Flip / Fade (IE Only)

For filters to work, you must set the width and height of your text. Of course it's unlikely you know that off the top of your head, but approximate values are fine. Your text wont stretch, but too large a width or height will create a space around it in some browsers, and too small a width or height might cut off the edges of your filter. Once you preview your text and see what's happening, you can adjust your width or height accordingly. All these filters work on images too.


Glow Text (IE Only)

Quote

<font style="width: 200px; height: 20px; filter: glow(color=deeppink, strength=5);"> Text </font>



Shadow Text (IE Only)

Quote

<font style="width: 250px; height: 20px; filter: shadow(color=teal, direction=200);"> Text </font>



Vertically Flipped Text (IE Only)

Quote

<font style="width: 200px; height: 20px; filter: flipv;"> Text </font>



Horizontally Flipped Text (IE Only)

Quote

<font style="width: 200px; height: 20px; filter: fliph;"> Text </font>



Fading Text (IE Only)

Quote

<font style="width: 200px; height: 20px; filter: alpha(opacity=0, finishopacity=100, style=1);"> Text </font>

<font style="width: 200px; height: 20px; filter: alpha(opacity=100, finishopacity=0, style=1);"> Text </font>




Sideways Writing (IE Only)

You can make your text appear sideways in the Internet Explorer browser using writing mode:


This text is sideways in IE!

Quote

<font style="writing-mode: tb-rl;"> write here </font>

"I don't like to commit myself about heaven and hell - you see, I have friends in both places"