Formatting with CSS
You can use CSS code in your action script projects to acheive more advanced effects. So before I look into how to use CSS in action script, we have to note a bit about CSS and it's text formatting abilities. There is a lot of things you can do with CSS but the syntax is really simple.
Changing Colors
All we simply have to do is set the color property. You can use a named color, hexadecimal value or the appropriate rgb values.
Example:
In action script, you are more often going to be formatting links though. You can format links by using a as the selector.Code:span { color: #FF0099; }
Example:
Background ColorsCode:a { color: #FF0099; }
We can change the background colors of elements very easily using the background-color property.
Text DecorationCode:span { background-color: #FF0099; }
There are quite a few things you can do with the text decoration properties. This is often used to remove underlines when you mouse over some text.
Examples:
Text TransformCode:text-decoration: underline; text-decoration: overline; text-decoration: underline overline; /* Text is underlined and overlined. */ text-decoration: blink; text-decoration: line-through;
The text transform properties allow you to control the letters in an element. You can capitalize text, change text to lowercase or change text to uppercase.
Theoretically, you could use this on a text field and it would make sure that the user doesn't enter uppercase letters.
Examples:
Code:text-transform: none; text-transform: lowercase; text-transform: uppercase; text-transform: capitalize;
Text alignment
These are used to control the alignment of text.Code:text-align: center; text-align: right; text-align: left;
Later, we look at different events you can do with CSS using mouseovers and other events. These will allow you greater control over labels in action script. You can use CSS on labels. Since, you can't use text format object on labels this provides you a method to format objects.
I miss the old days, before CSS.+rep
Really? Why? I sense sarcasm.
CSS makes thing so easy.
No sarcasm, lol. I just learned the old way where you changed text color with <font size="2" color="#FFFFFF" etc... >. I also prefer tables to floating div alignments. It is just because that is the way I learned HTML, back before CSS was available. I'm an old grunt groaning about nonsense.![]()
I find tables are easier to make them work in all browsers. Sure you lose some control but it is a lot easier.That is how I learned HTML also.
![]()
I'm still trying to get the hang of CSS. It's a different way of thinking from old HTML. It is better, but different.
Avoid using tables from SEO point of view. Tables makes designers to design websites easily but table puzzle the search spiders. If you can, then use css for designing.
I would disagree with that, somewhat. If a search spider can't find a link in a table, it's screwed up.
I would say, "Use tables for reporting tabular data, use div tags and CSS for layout."
Usually, people want their layout to be something like:
This is something that CAN be done with tables, but isn't what they were designed for. Div tags give you much better control for layout like the example above. With Div tags, you can alter the CSS and rearrange the sidebars, for example. With Tables, you're changing HTML code. Most themes rely on Div tag/CSS rather than tables.Code:Header area Menu area Body area left side bar content right side bar Footer area
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks