Not understanding CSS

Hello all,
I'm trying to get my head around using CSS to style my application, but I think I'm missing something, as it's is surprisingly difficult at the moment. What I've got just now is my CSS with a few simple classes defining fontSize etc, and to apply these I need to load the stylesheet, apply the stylesheet to each text element I want to use it on, and use the htmlText to give a specific <span> with a class.
There are a few things I'd like to be able to do:
1. Set a global font, so I don't need to attach the stylesheet to every single text element I create.
2. Is it really necessary to use htmlText and a <span class="whatever">...</span>, to apply a specific CSS class? Lets say I have two TextField elements in a container and I'd like to style them differently, this is the only way I can see of doing it with CSS.
All of the examples I can find, refer to using styleName on the element (although TextField doesn't appear to have this property), and applying a specific CSS class using that.
I think I'm just getting myself in a bit of a muddle (coming from an HTML/CSS background), and any help in straightening this out would be hugely appreciated.
Regards,
Allan

Hello all,
Further to my question, I've been trying to work how to to answer it, and have come up with a part way solution - but still not fully understanding what is going on. Thanks to the 'Flex 4 beta 2 in a week' videos I discovered the 'global' selector for CSS in Flex, so setting this up I thought would be nice and easy, but the styles from the global definition don't appear to be applied to my custom component.
What I have is a component which simply adds a TextField to the stage using AS and, for point of comparison, I've got a spark Label which is added to the stage using MXML. The style is correctly applied to the Label, but not my TextField as can be seen in a screenshot: http://www.sprymedia.co.uk/media/misc/flex4_css.png .
I can't understand why the global selector would not apply to my component. My CSS looks like this:
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/halo";
@namespace cx "components.*";
global
    fontFamily: Verdana;
    fontSize: 26;
color: #ffffff;
Can anyone offer a suggestion on how to make the global selector apply to my component's TextField as well?
Thanks,
Allan

Similar Messages

  • Trouble Understanding CSS Layout and Padding

    Hi,
    I'm having some serious problems understanding CSS layout techniques and the impact of padding and was hoping I could get some help.
    Here are a couple of pages that show examples of what I don't "get". The first has padding that causes the layout to look right. The second doesn't have padding but doesn't lay out as I would expect. Also, the amount of text affects the "bottom" div as well. I'm an old hand at HTML and could do this layout in my sleep using tables. Css is a different, frustrating story.
    http://www.libertywebmarketing.com/test/1.html
    http://www.libertywebmarketing.com/test/2.html
    Thanks.
    Fitz21

    Thank you for the help.There's a lot of valuable info in these answers that I'm going to have to study. I never thought of applying classes to Div tags, but I guess I have to start learning somewhere. I'm not sure how to use the technique, but I'll definately look into it. If I could wake up tomorrow and know what you all know simply by wishing it, I would.
    I see that there are many things I have to learn about using CSS and I'd really like to see some real world examples that don't look like typical cheesy CSS designs with columns. If I were going to design this page using HTML, I would probably do something like this: http://www.libertywebmarketing.com/test/3.html
    (The last two tables show the table structure and use of a spacer. I know this a seriously antiquated way of doing it, but it's to illustrate what I'm trying to accomplish: Namely, staggered, left/right alternating boxes that will expand properly depending on the amount of copy or the vertical height of the photo in them.) 
    Dreamweaver 101,
    I have "Dreamweaver 8 The Missing Manual" by David Sawyer McFarland, but I find it really concentrates on "typical CSS designs" that look like Content mangement templates. While I agree it's a valuable book, there's nothing in there I have found that addresses anything like what I'm trying to do. Is the Dummies book better for atypical layouts?
    Again, thank you all.
    Fitz21

  • My question is How to do old 4S to new 5 S to save same into phone but can not do ask someone last night and did not help me as I am deaf and not clear and Please man told me download from computer and I am not understand at all

    Yesterday We went to At and T store and they told me to download from old phone to new phone and I am really upset and I got Icloud and prove but part of still in 4S and has not go in 5S and that is biggest problem and no commuication that woman stay follow what she said but still not working so I do not know what else to do my do not understand and I would like to have someone do for us and AT and T store can not do that part so Told me Apple store and I called last night talk to some one on Apple store but told me that no go back to AT and T store so now total confuse and I am not get anywhere so and why they will not do it so therefore I do not think computer that not clear for us because we have no experince in computer program for this so both are deaf and not clear so over 50 years age and so we need face someone to do for us and told us do our self which is total upset us more so because my twins are in Orlando and can not call them because of problem contiunes in heart so I need someone who we can trust and help us. I do have IPAD mini and almost lost my calls to my twins and today I think get back but not 100 % so I am kind upset and who email us or I will have to go Apple Store and see if they know personal.

    Open this support document http://support.apple.com/kb/HT2109 print it from the computer and follow the steps there. You need to backup your data from the first device and then restore that to the new device.

  • HT204135 I update my Mac to version 10.9.2 and now my printer does not work anymore. I did all the software updates and I do not understand why my mac does not recognize the printer anymore?

    I update my Mac to version 10.9.2 and now my printer does not work anymore. I did all the software updates and I do not understand why my mac does not recognize the printer anymore?

    Go to the website of the manufacturer of your printer and check to see if they have released an updated driver for your particular model.

  • Users of imovie experience a lot of problems and crying for help and no one at Apple did not respond I do not understand how a company like Apple puts experts to help users Please note that anonymous experts in Internet offer their help for money

    Users of imovie experience a lot of problems and crying for help and no one at Apple did not respond
    I do not understand how a company like Apple puts experts to help users
    Please note that anonymous experts in Internet offer their help for money

    Users of imovie experience a lot of problems and crying for help and no one at Apple did not respond
    I do not understand how a company like Apple puts experts to help users
    Please note that anonymous experts in Internet offer their help for money

  • I can no longer access Bejeweled Blitz through my facebook account.  I get the message that says, "your browser sent a request that this server could not understand. Size of a request header field exceeds server limit".  Help please.

    I can no longer access Bejeweled Blitz through facebook.  I get the message, "your browser sent a request that this server could not understand. Size of a request header field exceeds server limit". I can access Bejeweled through FB using my husband's log in so to me that suggests the problem is with my log in. Help please.

    Contact FB or use another browser. 

  • Cannot retrieve my e-mail "browser sent request server could not understand. Size of request header field exceeds server limit"

    Upgraded to Firefox 5.0.1 yesterday. No, after logging on to firefox, which takes me to my comcast page and when I try to get
    my e-mail I get this message "your browser sent a request this server could not understand. Size of request header field exceeds server limit" Then it says something about "cookies" I also tried to connect to other sites and get similar messages. Just to let you know I am not a guru, and 80 years old, but I did not have this problem with the previous version. Question, why are the headers repeated? Could that be the problem???

    This issue can be caused by corrupted cookies.
    Clear the cache and the cookies from sites (e.g. comcast) that cause problems.
    "Clear the Cache":
    * Firefox > Preferences > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    * Firefox > Preferences > Privacy > Cookies: "Show Cookies"

  • I bought a MacBook Pro Retina a few months ago.  I do not understand why I have more than 100 GB of Others in my storage?  Can anyone please explain?

    My MacBook Pro with Retina display suddenly gave me a message when I boot up ie 'Your startup Disk is full'  then after using a few more times, the screen suddenly become frozen white.  Upon getting help, I managed to delete some files but when I checked the Storage space, the largest occupied space was orange color, named 'Others' which is more than 100 GB out of the total 120 GB!!  I am surprised and do not understand what 'Others' mean.  It is definitely not Audio, Video, Pictures, documents etc  It is not mail too.  If anyone can tell me what 'Others' in storage mean and how to see the contents of 'Others' so that I can delete those irrelevant files.  Any advice and guidance is very much appreciated.  Thanking you in anticipation of your early reply.
    Joe

    "Other" includes everything that is not audio, movies, photos, apps and backups.  In other words it includes the OS, mail, documents...  See http://pondini.org/OSX/LionStorage.html and What is "Other" and What Can I Do About It?- Apple Support Communities https://discussions.apple.com/docs/DOC-5142
    To clear disk space see  https://discussions.apple.com/message/24012341#24012341 (in addition to Body's excellent document).

  • HT201250 I do not understand how to restore my entire iTunes music library with Playlists and all?

    I do not understand how to restore my iTunes library inlcuding Playlists and all? In clearing out an older Powerbook I had not signed out of MobileMe when clearing iTunes. That deleted many songs and Playlists on the iMac and iPhone. Help is appreciated.

    And yes, I have a 500G external HD so I know the data is in there.

  • I noticed this question has been asked a lot, but I still do not understand. How do I get my ALL of my iTunes music onto iCloud.  I have already subscribed to match and increased my icloud storage. Only some of my music is in the cloud, not on iphone

    I have noticed that this question has been asked a lot, but I am still not understanding. How do I move ALL of my music on iTunes into iCloud? I have subscribed to match and increased my iCloud storage. Only part of my music is in the Cloud and not on my iPhone.

    Hello, Crafter Lady. 
    Thank you for visiting Apple Support Communities.
    You may find this article helpful when troubleshooting issues with iTunes Match.
    iTunes Store: Troubleshooting iTunes Match
    http://support.apple.com/kb/ts4054
    Cheers,
    Jason H.

  • IBooks Author. I am not allowed to sign in with my Apple ID on iTunes Connect when I am trying to publish my book in iBooks Author. I do not understand why because I have fulfilled the first steps creating an account and informed my IRS tax number...

    I am not allowed to sign in with my Apple ID on iTunes Connect when I am trying to publish my book in iBooks Author. I do not understand why because I have fulfilled the first steps creating an account and informed my IRS tax number...

    The recommendation is always to make another ID for use with a paid books account. And while I can't swear this is at the root of your issue, you should in any case reach out to Apple for assistance on this one, I think.
    Account Applications:
    [email protected]
    Global Phone Support
    We have expanded English-language publisher phone support. To make contacting the iBookstore support even easier, new local phone numbers are now available for Australia, France, Germany, Italy, Netherlands, Spain, and the U.K. Support is available Monday to Friday, from 7 a.m. to 5 p.m. (PT).
    Country
    Phone Number
    Australia
    1300 307 504
    Note that this is a low tariff number.
    France
    0805 540 117
    Germany
    0800 664 5307
    Italy
    800 915 902
    Netherlands
    0800 0201 578
    Spain
    900 812 687
    U.K.
    0800 975 0615
    U.S.
    +1 (877) 206-2092
    Toll-free from U.S. and Canada.
    Good luck

  • Can't install mcafee in vmfusion running under windows xp; error is not understandable; any ideas?

    Can't install mcafee in vmfusion running under windows xp; error is not understandable; any ideas?

    Please repost in a VMWare Fusion forum, you can find it at:
    http://communities.vmware.com/community/vmtn/desktop/fusion.

  • My flash reads the xml, but does not understand the tag php....

    my flash reads the xml, but does not understand the tag php. I want to read my xml dynamically, please help me.
    code:
    stop();
    function randomOrder(targetArray)
        var _loc2 = targetArray.length;
        var _loc3 = [];
        for (var _loc1 = 0; _loc1 < _loc2; ++_loc1)
            _loc3[_loc1] = _loc1;
        } // end of for
        var _loc4 = [];
        for (var _loc1 = 0; _loc1 < _loc2; ++_loc1)
            _loc4[_loc1] = _loc3.splice(Math.floor(Math.random() * _loc3.length), 1);
        } // end of for
        var _loc5 = [];
        for (var _loc1 = 0; _loc1 < _loc2; ++_loc1)
            _loc5[_loc1] = targetArray[_loc4[_loc1]];
        } // end of for
        return (_loc5);
    } // End of the function
    var randomNUM = "?n=" + random(9999);
    _root.lan = 1;
    var homehead;
    var homelink;
    var homelinkwindow;
    var homebg;
    var homeflash;
    var lamp = Array();
    var promo = Array();
    var promobottom = Array();
    var headimg = Array();
    f_xmlwork2 = new XML();
    f_xmlwork2.ignoreWhite=true;
    f_xmlwork2.load("banner.php");
    f_xmlwork2.onLoad = function(sucess){
        if (sucess){
             trace ("XML loaded!");
             f_xmlItemx2 = parseInt(this.firstChild.childNodes[0].firstChild);
             f_totalx2 = f_xmlItemx2.length;
            trace(f_totalx2);
             var _loc12 =0;
             // declarar a imagem de fundo
             homebg = this.firstChild.childNodes[0].firstChild.nodeValue;
             f_headimg = this.childNodes[1];
                 for (var _loc2 = 0; _loc2 < f_headimg.childNodes.length; ++_loc2)    {
    juju = f_headimg.childNodes[_loc2];
    jj = headimg.push({headimg: f_headimg.childNodes[_loc2].attributes.headimg, bgimg: f_headimg.childNodes[_loc2].attributes.bgimg, msgimg: f_headimg.childNodes[_loc2].attributes.msgimg, leftthrow: f_headimg.childNodes[_loc2].attributes.leftthrow, rightthrow: f_headimg.childNodes[_loc2].attributes.rightthrow});
                 //end for
    allpromo = this.childNodes[2];
    jjpromo = allpromo.childNodes;
    for (var _loc2 = 0; _loc2 < allpromo.childNodes.length; ++_loc2)
    trace (jjpromo[_loc2].attributes.title);
    jj = promo.push({img: jjpromo[_loc2].attributes.img, title: jjpromo[_loc2].attributes.title, url: jjpromo[_loc2].attributes.url, window: jjpromo[_loc2].attributes.window, info: jjpromo[_loc2].childNodes[0].nodeValue});
        // end of for
        allpromobottom = this.childNodes[3];
        jjpromobottom = allpromobottom.childNodes;
        for (var _loc2 = 0; _loc2 < allpromobottom.childNodes.length; ++_loc2)
            trace (jjpromo[_loc2].attributes.title);
            jj = promobottom.push({url: jjpromobottom[_loc2].attributes.url, window: jjpromobottom[_loc2].attributes.window, info: jjpromobottom[_loc2].childNodes[0].nodeValue});
        } // end of for
         if (f_xmlwork2.loaded == true)
            headimg = randomOrder(headimg);
            for (var _loc2 = 0; _loc2 < f_headimg.childNodes.length; ++_loc2)
                trace (headimg[_loc2].headimg);
            } // end of for
            play ();
        } // end if
    trace(f_xmlwork2);
    stop();
    PHP code:
    <?
    $link=  mysql_connect("localhost","rnpac_eco","123");
    mysql_select_db("rnpac");
    $dir="banner/";
    $dir1="produtos/img_pro/";
    $dir2="universo/actividades/";
    $sql = 'SELECT tbl_produto.id_produto, tbl_produto.produto, tbl_produto.legenda, tbl_produto.detalhe, tbl_produto.preco, tbl_produto.produto_cat_id, tbl_detalhe_produto.proprietario, tbl_detalhe_produto.local, tbl_detalhe_produto.qualidade, tbl_detalhe_produto.alcool, tbl_detalhe_produto.acidez, tbl_detalhe_produto.ph, tbl_detalhe_produto.informacao, tbl_detalhe_produto.gestor, tbl_detalhe_produto.condicionamento, tbl_detalhe_produto.detalhe_t, tbl_detalhe_produto.interesse, tbl_detalhe_produto.transporte, tbl_detalhe_produto.produto_id, tbl_imagem_produto.id_imagem, tbl_imagem_produto.imagem1, tbl_imagem_produto.imagem2, tbl_imagem_produto.imagem3, tbl_imagem_produto.imagem4, tbl_imagem_produto.imagem5, tbl_imagem_produto.imagem6
    FROM tbl_cat_produto, tbl_produto, tbl_detalhe_produto, tbl_imagem_produto WHERE tbl_produto.id_produto = tbl_detalhe_produto.produto_id AND tbl_produto.id_produto = tbl_imagem_produto.produto_id ORDER BY RAND()';
    $resultado = mysql_query($sql)
    or die ("Não foi possível realizar a consulta.");
    $row1=mysql_fetch_array($resultado);
    $sql = "SELECT  tbl_sub_universo.id_subuniverso, tbl_sub_universo.subuniverso, tbl_sub_universo.universo_id, tbl_actividade.id_actividade, tbl_actividade.entidade, tbl_actividade.legenda, tbl_actividade.subuniverso_id, tbl_actividade.det, tbl_actividade.preco, tbl_actividade.data, tbl_detalhe_actividade.actividade_id, tbl_detalhe_actividade.periodo, tbl_detalhe_actividade.descricao, tbl_detalhe_actividade.programa, tbl_detalhe_actividade.informacoes, tbl_detalhe_actividade.actividades, tbl_detalhe_actividade.localizacao, tbl_detalhe_actividade.locais, tbl_detalhe_actividade.servicos, tbl_imagem_produto.id_imagem, tbl_imagem_produto.imagem1,tbl_imagem_produto.imagem2, tbl_imagem_produto.imagem3, tbl_imagem_produto.imagem4, tbl_imagem_produto.imagem5, tbl_imagem_produto.imagem6, tbl_imagem_produto.actividade_id FROM  tbl_sub_universo, tbl_actividade, tbl_detalhe_actividade, tbl_imagem_produto WHERE tbl_actividade.id_actividade =tbl_imagem_produto.actividade_id AND tbl_actividade.id_actividade =tbl_detalhe_actividade.actividade_id ORDER BY RAND()";
    $resultado = mysql_query($sql)
    or die ("Não foi possível realizar a consulta.");
    $row2=mysql_fetch_array($resultado);
    $query='SELECT * FROM tbl_banner ORDER BY RAND()';
    $resultado = mysql_query($query);
    echo' <?xml version=\"1.0\"?>
    <home_left_headline>
    <bgimg>'.$dir2.''.$row1['imagem1'].'</bgimg>
    </home_left_headline>
    <home_flash>';
    while($row = mysql_fetch_array($resultado)) {
    echo'<swf headimg="" bgimg="" msgimg="" leftthrow="" rightthrow=""></swf>';
    echo'</home_flash>';
    echo'<promotop>
    <promo img="" title="" url="" ><![CDATA[]]></promo>
    <promo img="" title="" url="" ><![CDATA[]]></promo>
    </promotop>';
    mysql_close($link);

    i have two files banner.php, for testing my flash banner.
    This one works:
    -------------------------------| banner.php |---------------------------------------------
    <?xml version="1.0"?>
    <content>
    <settings>
    <menu X='160'/>
    </settings>
    <nav>
    <main Name='HOME' Link='home.swf'/>
    <main Name='EMPRESA' Link='home.swf' >
    <sub Name='HISTORIA' Link='content.swf' toLoad='content/contentrosa.xml'/>
    <sub Name='OBJECTIVO' Link='content.swf' toLoad='content/contentrosa2.xml'/>
    </main></nav>
    </content>
    -------------------------------|end  banner.php |---------------------------------------------
    this other does not work:
    -------------------------------| banner.php |---------------------------------------------
    <?php
    echo"<?xml version="1.0"?>
    <content>
    <settings>
    <menu X='160'/>
    </settings>
    <nav>
    <main Name='HOME' Link='home.swf'/>
    <main Name='EMPRESA' Link='home.swf' >
    <sub Name='HISTORIA' Link='content.swf' toLoad='content/contentrosa.xml'/>
    <sub Name='OBJECTIVO' Link='content.swf' toLoad='content/contentrosa2.xml'/>
    </main></nav>
    </content>";
    ?>
    -------------------------------|end  banner.php |---------------------------------------------
    Why? What is wrong? why does my flash does not understand the tag php
    Message was edited by: armandix

  • I do not understand iPhoto and/or Photo Stream, help me?

    I do not understand iPhoto to say the least. I've imported my photos which I have stored on an external networked hard drive. However after they've been uploaded to the iPhoto library, I've got NUMEROUS duplicates which seem to be showing as different events even though they are the same photo.
    Another thing is that in Photo Stream which I have turned on my iPhone 4, I seem to have photos showing up in there that have nothing to do with a photo I've taken on my iPhone or manually dragged them to Photo Stream. They are mostly some old photos that I've NEVER had on my iPhone at all. How did they get there. My photos that I've taken with the phone or saved on my Iphone are there just like I was expecting but most of these photos, and this is while I'm on my iMac, are just a bunch of random photos. I don't even know how to delete these photos in Photo Stream to try and start over. 
    Could someone help me understand iPhoto and/or Photo Stream, these are two different questions please!

    Is there a specific file that iPhoto makes and stores on my computer or the external drive that has the iPhoto library? I want to delete all instances of it and try reloading my library.
    Also, how do I reload or start fresh a Photo Stream library on my computer? What's weird is that the photos on my iMac are not what's on my iPhone. I mean I have the ones that are on my iPHone are within the iPhoto's Photo Stream but then there is also a bunch of other photos that I have no idea how they got there.

  • TS3694 I bought the iphone 5 has not been one week do not understand why the home key of the time activities at stops working, not crash or fall. hope its help, probably due to software, not hardware failure, what do I do now?

    I bought the iphone 5 has not been one week do not understand why the home key of the time activities at stops working, not crash or fall. hope its help, probably due to software, not hardware failure, what do I do now?

    Restore iPhone with current iTunes on computer. See if better. If still problem, make Genius reservation or set up Service and take or send to Apple for resolution. Of if easier for you, take receipt and iPhone, box and everything and return to where you bought it.

Maybe you are looking for