+ Reply to Thread
Results 1 to 10 of 10

Thread: CSS text properties

  1. #1
    Join Date
    Mar 2008
    Posts
    7,144
    Rep Power
    86

    CSS text properties

    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:

    Code:
    span {
    	color: #FF0099;
    }
    In action script, you are more often going to be formatting links though. You can format links by using a as the selector.

    Example:

    Code:
    a {
    	color: #FF0099;
    }
    Background Colors

    We can change the background colors of elements very easily using the background-color property.

    Code:
    span {
    	background-color: #FF0099;
    }
    Text Decoration

    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:

    Code:
    text-decoration: underline;
    text-decoration: overline;
    text-decoration: underline overline; /* Text is underlined and overlined. */
    text-decoration: blink;
    text-decoration: line-through;
    Text Transform

    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

    Code:
    text-align: center; 
    text-align: right;
    text-align: left;
    These are used to control the alignment of text.

    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.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Jordan Guest

    Re: CSS text properties

    I miss the old days, before CSS. +rep

  4. #3
    Join Date
    Mar 2008
    Posts
    7,144
    Rep Power
    86

    Re: CSS text properties

    Really? Why? I sense sarcasm.

    CSS makes thing so easy.

  5. #4
    Jordan Guest

    Re: CSS text properties

    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.

  6. #5
    Join Date
    Mar 2008
    Posts
    7,144
    Rep Power
    86

    Re: CSS text properties

    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.

  7. #6
    Join Date
    Jul 2006
    Posts
    16,475
    Blog Entries
    75
    Rep Power
    143

    Re: CSS text properties

    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.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  8. #7
    ruskin012 is offline Newbie
    Join Date
    Aug 2009
    Posts
    8
    Rep Power
    0

    Re: CSS text properties

    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.

  9. #8
    Join Date
    Jul 2006
    Posts
    16,475
    Blog Entries
    75
    Rep Power
    143

    Re: CSS text properties

    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."
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  10. #9
    Join Date
    Mar 2008
    Posts
    7,144
    Rep Power
    86

    Re: CSS text properties

    Quote Originally Posted by WingedPanther View Post
    I would say, "Use tables for reporting tabular data, use div tags and CSS for layout."

    I've always heard people say that tables are bad for layout but why is this? Wouldn't you want to do something in the simplest way possible? Tables are simple.

  11. #10
    Join Date
    Jul 2006
    Posts
    16,475
    Blog Entries
    75
    Rep Power
    143

    Re: CSS text properties

    Usually, people want their layout to be something like:
    Code:
    Header area
    Menu area
    Body area
      left side bar
      content
      right side bar
    Footer area
    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.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Properties
    By Tonchi in forum C# Programming
    Replies: 6
    Last Post: 05-23-2011, 09:41 AM
  2. CSS 3.0 Background Properties
    By jhonpeter in forum HTML Programming
    Replies: 3
    Last Post: 08-23-2010, 07:05 AM
  3. C# properties practice
    By Siten0308 in forum C# Programming
    Replies: 4
    Last Post: 08-13-2009, 03:41 PM
  4. File Properties
    By bladactania in forum C and C++
    Replies: 4
    Last Post: 04-27-2008, 04:45 AM
  5. Custom control properties
    By Ronin in forum C# Programming
    Replies: 1
    Last Post: 09-15-2006, 01:17 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts