+ Reply to Thread
Results 1 to 10 of 10

Thread: CSS text properties

  1. #1
    Code Slinger chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5's Avatar
    Join Date
    Mar 2008
    Posts
    7,023
    Blog Entries
    1

    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. #2
    Administrator Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan's Avatar
    Join Date
    Nov 2005
    Location
    Hendersonville, NC
    Posts
    24,556
    Blog Entries
    97

    Re: CSS text properties

    I miss the old days, before CSS. +rep

  3. #3
    Code Slinger chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5's Avatar
    Join Date
    Mar 2008
    Posts
    7,023
    Blog Entries
    1

    Re: CSS text properties

    Really? Why? I sense sarcasm.

    CSS makes thing so easy.

  4. #4
    Administrator Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan's Avatar
    Join Date
    Nov 2005
    Location
    Hendersonville, NC
    Posts
    24,556
    Blog Entries
    97

    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.

  5. #5
    Code Slinger chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5's Avatar
    Join Date
    Mar 2008
    Posts
    7,023
    Blog Entries
    1

    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.

  6. #6
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,682
    Blog Entries
    57

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

  7. #7
    Newbie ruskin012 is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    8

    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.

  8. #8
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,682
    Blog Entries
    57

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

  9. #9
    Code Slinger chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5's Avatar
    Join Date
    Mar 2008
    Posts
    7,023
    Blog Entries
    1

    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.

  10. #10
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,682
    Blog Entries
    57

    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.
    CodeCall Blog | CodeCall Wiki | Shareware
    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. AS: Formatting Text Fields
    By chili5 in forum Tutorials
    Replies: 3
    Last Post: 08-29-2009, 09:10 AM
  2. GUI Development with the Netbeans IDE
    By chili5 in forum Java Tutorials
    Replies: 3
    Last Post: 08-10-2009, 02:53 AM
  3. Backup current text in textbox after x amount of time
    By Grue in forum Visual Basic Programming
    Replies: 4
    Last Post: 06-11-2009, 11:29 AM
  4. Replies: 0
    Last Post: 02-12-2009, 12:38 AM
  5. Replies: 3
    Last Post: 09-15-2007, 10:08 PM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

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