TextArea hyperlink styling

Although Flex Builder 3 gives a wide variety of controls over
the style of a TextArea, I have not found a property that allows
styling of hyperlinks. I would like to be able to have htmlText
shown in a TextArea to have styling for hyperlinks, including
different styles for the pseudo-classes of hover, etc.
I have seen a couple of complex workarounds for this from FB
2 days, but would love to find a simple or elegant way to
accomplish this.
Thanks in advance,
James

I have found a way to do this reasonably easily. Here is what
I did:
1. Include in <mx:Application>:
creationComplete="defineStyles();"
2. ....which refers to this function and the variable it
needs:
<mx:Script>
<![CDATA[
public var ss:StyleSheet = new StyleSheet();
public function defineStyles():void
this.styledTxt.styleSheet = this.ss;
var h:Object = new Object();
h.color = "#970909";
h.textDecoration = "underline";
ss.setStyle("a:hover", h);
var a:Object = new Object();
a.color = "#0066ff";
a.textDecoration = "none";
ss.setStyle("a:link", a);
var v:Object = new Object();
v.color = "#0066ff";
v.textDecoration = "none";
ss.setStyle("a:visited", v);
var t:Object = new Object();
t.color = "#0066ff";
t.textDecoration = "none";
ss.setStyle("a:active", t);
]]>
</mx:Script>
3. And id your TextArea as id="styledTxt"
-=-=-=-=-=-
You may of course adjust variables above as needed.
I am using this for an application that imports blog postings
through HTTPService, and for my content call I use
htmlText="{gettheItem.lastResult.item.thetext}" referring to that
HTTPService call. I mention this so that you can know that this
styling is working on bulk imported data that has anchor links in
it and is properly showing them with the styling I have specified.
Note that this posting from the Flashlit blog was helpful to
me:
http://rantworld.blogs.com/flashlit/2006/08/styling_flex_te.html
I hope this is helpful,
James

Similar Messages

  • Hyperlink styling troubles...

    Hi,
    http://www.avenuedesigners.com/
    http://www.avenuedesigners.com/css/main.css
    The links "Privacy" and "Accessibility" in the footer on the
    right-hand
    side, show their styled dashed bottom border on hover in
    Firefox and Opera
    on PC, but not in IE6 & 7.
    All other hyperlinks on the page use the exact same code to
    show a dashed
    bottom border (e.g., the main content links, and also the
    "Jump to main
    content" link below the navigation bar). IE6 & 7 displays
    all of these
    correctly, just not the footer links. Why and how can I fix
    this?
    Thanks for your time,
    Shane H
    [email protected]
    http://www.avenuedesigners.com
    =============================================
    Back for 2007, close-up magic:
    http://deceptivemagic.com
    Web dev articles, photography, and more:
    http://sourtea.com
    =============================================
    Proud GAWDS member
    http://www.gawds.org/showmember.php?memberid=1495
    Delivering accessible websites to all ...
    =============================================

    Interesting.
    In your CSS
    #footer .links {float:right; padding-right: 10px; }
    if I remove the float:right and make it
    #footer .links {padding-right: 10px; }
    The links work the way they should with the dashed
    border-bottom showing on
    hover.
    Don't know why this is happening.
    Some unrelated errors:
    Error: hideOnLoad is not defined
    Source File:
    http://www.avenuedesigners.com/scripts/external.js
    Line: 51
    Error: The stylesheet
    http://www.avenuedesigners.com/error404.html
    was not
    loaded because its MIME type, "text/html", is not "text/css".
    Source File:
    http://www.avenuedesigners.com/
    Line: 0
    You cannot lose until you give up !!!
    "Shane H" <[email protected]> wrote in
    message
    news:epg533$58u$[email protected]..
    > Hi,
    >
    >
    http://www.avenuedesigners.com/
    >
    http://www.avenuedesigners.com/css/main.css
    >
    > The links "Privacy" and "Accessibility" in the footer on
    the right-hand
    > side, show their styled dashed bottom border on hover in
    Firefox and Opera
    > on PC, but not in IE6 & 7.
    >
    > All other hyperlinks on the page use the exact same code
    to show a dashed
    > bottom border (e.g., the main content links, and also
    the "Jump to main
    > content" link below the navigation bar). IE6 & 7
    displays all of these
    > correctly, just not the footer links. Why and how can I
    fix this?
    >
    > Thanks for your time,
    >
    > --
    > Shane H
    > [email protected]
    >
    http://www.avenuedesigners.com
    >
    > =============================================
    > Back for 2007, close-up magic:
    >
    http://deceptivemagic.com
    >
    > Web dev articles, photography, and more:
    >
    http://sourtea.com
    > =============================================
    > Proud GAWDS member
    >
    http://www.gawds.org/showmember.php?memberid=1495
    >
    > Delivering accessible websites to all ...
    > =============================================
    >
    >
    >

  • Hyperlinkable TextArea

    Can someone give me a clue on how to make the URL displayed in the TextArea hyperlinkable. The Program displays http://www.yahoo.com but I want to be able to click on it and have it open into a new browser. It currently runs fine without the hyperlink but has compile errors. Thanks :^)
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import java.awt.event.*;
    import javax.swing.JEditorPane.*;
    import javax.swing.text.html.*;
    public class Hyperlinkdemo
         public static void main(String[] args)
              JEditorPane myEditorPane;
              myEditorPane.addHyperlinkListener(new MyHyperlinkListener());
              final String website = "http://www.yahoo.com";
              JLabel msgLabel = new JLabel("Hyperlinkable Test Program");
              JButton runButton = new JButton("Run");
              final TextArea output = new TextArea(10,30);
              JScrollPane scroller = new JScrollPane(output);
              JFrame frame = new JFrame("Hyperlinkdemo");
              JPanel buttonbox = new JPanel();
              JPanel jp = new JPanel();
              JPanel northPanel = new JPanel();
              frame.getContentPane().setLayout(new BorderLayout());
              jp.setLayout(new FlowLayout());
              jp.add(scroller);
              northPanel.add(msgLabel);
              northPanel.add(runButton);
              website.add(myEditorPane);
              frame.getContentPane().add(northPanel, "North");
              frame.getContentPane().add(jp, "South");
              runButton.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent e){
                        output.append(website + "\n");
              frame.pack();
              frame.show();
         class MyHyperlinkListener implements HyperlinkListener {
         public void hyperlinkUpdate(HyperlinkEvent evt) {
         HyperlinkEvent.EventType type = evt.getEventType();
         if (type.equals(HyperlinkEvent.EventType.ACTIVATED)) {
         myEditorPane.setPage(evt.getURL());
    }

    Well i'm sure there are a lot of others that can help you better than myself, but i think the key to your problem is in your JEditorPane call setEditable(false). The Java API itself has a good example under JEditorPane.
    Here's what i came up with after modifying your code
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.event.*;
    import javax.swing.text.html.*;
    import java.io.*;
    public class Hyperlinkdemo
    JEditorPane myEditorPane;     
    final String website = "http://www.yahoo.com";
    public void init()
    myEditorPane = new JEditorPane("text/html","");
    myEditorPane.addHyperlinkListener(new MyHyperlinkListener());
    myEditorPane.setEditable(false);
    JLabel msgLabel = new JLabel("Hyperlinkable Test Program");
    JButton runButton = new JButton("Run");
    JScrollPane scroller = new JScrollPane();
    scroller.setViewportView(myEditorPane);
    scroller.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    //scroller.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    JFrame frame = new JFrame("Hyperlinkdemo");
    JPanel buttonbox = new JPanel();
    JPanel northPanel = new JPanel();
    northPanel.add(msgLabel);
    northPanel.add(runButton);
    frame.getContentPane().add(northPanel, "North");
    frame.getContentPane().add(scroller);
    runButton.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e){
    myEditorPane.setText("<a href=\"http://www.yahoo.com\">www.yahoo.com</a>");
    System.out.println(myEditorPane.getContentType());
    frame.addWindowListener(new MyWindowAdapter());
    frame.pack();
    frame.setSize(300,300);
    frame.show();
    class MyWindowAdapter extends WindowAdapter
         public void windowClosing(WindowEvent e)
              System.exit(0);     
    public static void main(String args[])
         Hyperlinkdemo demo = new Hyperlinkdemo();
         demo.init();     
    class MyHyperlinkListener implements HyperlinkListener
    public void hyperlinkUpdate(HyperlinkEvent e)
         HyperlinkEvent.EventType type = e.getEventType();
         if (type.equals(HyperlinkEvent.EventType.ACTIVATED))
              JEditorPane pane = (JEditorPane) e.getSource();
              JEditorPane another = new JEditorPane();
              JFrame newframe = new JFrame("New window");
              if (e instanceof HTMLFrameHyperlinkEvent)
              HTMLFrameHyperlinkEvent evt = (HTMLFrameHyperlinkEvent)e;
              HTMLDocument doc = (HTMLDocument)pane.getDocument();
              doc.processHTMLFrameHyperlinkEvent(evt);
              else
              try
                        another.setPage(e.getURL());
                        newframe.getContentPane().add(another);
                        newframe.pack();
                        newframe.setSize(100,100);
                        newframe.show();
              catch (Throwable t)
                   t.printStackTrace();
    It provides a hyperlink after the RUN button is clicked, and pops the clicked result in another frame. Hope this helps

  • TLF applying hyperlinks issue

    Hi,
    I have a textArea in which I have assigned a textflow. On the text if I want to apply a hyperlink then I give a URL and target. Now if I haven't applied any other formatting to the text it creates a hypelink and makes the text blue and underlined, which is the normal case.
    Now suppose I change the fontSize of the text and then apply a hyperlink, then the link gets applied, but the text neither gets any color , nor does it become underlined.
    But if I do a Ctrl + Click on the same text, my link gets opened. But the hyperlink styling doesn't get applied.
    This is what I am doing for applying link to some text:
    public function changeLink( urlLink : String, target : String,  extendToOverlappingLinks : Boolean):void
                if ( myTextArea.textFlow && myTextArea.textFlow.interactionManager is IEditManager)
                     IEditManager(myTextArea.textFlow.interactionManager).applyLink( url, _target, extendToOverlappingLinks);        
    So why is this happening ?
    Thanks

    Example in http://blog.flexexamples.com/2009/06/28/styling-hyperlinks-in-a-textfl ow-object-in-flex-4/
    You can copy the code below, which runs correctly.
    <?xml version="1.0" encoding="utf-8"?>
    <!-- http://blog.flexexamples.com/2009/06/28/styling-hyperlinks-in-a-textflow-object-in-flex-4/ -->
    <s:Application name="Spark_TextArea_textFlow_linkHoverFormat_test"
                   xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/halo">
        <fx:Script>
            <![CDATA[
                import flashx.textLayout.conversion.TextConverter;
                import flashx.textLayout.elements.TextFlow;
                [Bindable]
                var markup:String = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"+
        "<TextFlow xmlns=\"http://ns.adobe.com/textLayout/2008\" whiteSpaceCollapse=\"preserve\" fontSize=\"16\" paragraphSpaceAfter=\"15\" paddingTop=\"4\" paddingLeft=\"4\">"+
            "<linkNormalFormat color=\"#00ff00\" textDecoration=\"underline\" />"+
            "<linkHoverFormat color=\"#ff0000\" textDecoration=\"underline\" />"+
            "<linkActiveFormat color=\"#ff00ff\" textDecoration=\"underline\" />"+
            "<format id=\"code\" backgroundColor=\"#000000\" backgroundAlpha=\"0.1\" fontFamily=\"_typewriter\" />"+
            "<p fontWeight=\"bold\">The following excerpt is from <a href=\"http://blog.flexexamples.com/\" target=\"_self\">Flex Examples</a>:</p>"+
            "<p>The following example shows how you can import a TextFlow object from an XML object in Flex 4 by using the static <span format=\"code\">TextFlowUtil.importFromXML()</span> method.</p>"+
            "<p>For more information, see <a href=\"http://blog.flexexamples.com/2009/06/25/importing-a-text-flow-from-an-xml-object-in-flex-4 /\">\"Importing a text flow from an XML object in Flex 4\"</a>.</p>"+
        "</TextFlow>";
                [Bindable]
                var tf:TextFlow = TextConverter.importToFlow(markup,TextConverter.TEXT_LAYOUT_FORMAT);
            ]]>
        </fx:Script>
        <s:TextArea id="txtArea"
                    textFlow="{tf}"
                    editable="false"
                    width="400"
                    horizontalCenter="0"
                    verticalCenter="0" />
    </s:Application>
    PS:
    I used TextConverter.importToFlow instead of TextFlowUtil.importFromString, because the former one is a tlf function under our controls, while the latter one is a flex function. I'm accustomed to take advantage of our own functions.

  • Spry Validation For PHP Form

    Hello All,
    I am currently using the Spry Validation within Dreamweaver 5.1.1 and it was working in my development environment until yesterday. I did not change directories so I believe it is not an issue with my file structure.  Below you will see my baic form set up and for some reason, when I load my page, all of the spry error messages are visable. Previously, the page would load and it would not appear until there was an error after submitting the page.  Maybe I'm missing something but an extra pair of eyes does not hurt.  The ".textfieldRequiredMsg" class displays automatically when it is set in the css file to "display: none:".
    I'm stumped:
    <meta http-equiv="X-UA-Compatible" content="IE=100"> <!-- IE fights me on forms -->
    <title>Company Name</title>
    <link rel="stylesheet" href="css/style.css" media="screen">
    <!--[if IE]>
    <link rel="stylesheet" href="css/ie.css" media="screen"?
    <![endif] -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script src="js/jquery.placeholder.js"></script>
    <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <form action="calltoaction/contact.php" id="contact" style="margin-top: -20px;" method="post" name="contact">
                      <div class="row">
                            <div class="left"><span id="sprytextfield1">
                            <input id="name" placeholder="Name" type="text" name="Name" autofocus required>
                            <span class="textfieldRequiredMsg">A value is required.</span></span></div>  
                             <div class="left">
                               <input id="pharmacyname" placeholder="Pharmacy Name" type="text" name="BusinessName" required>
                            </div>               
                       </div>
              <div class="row">
              <div class="left">
                <input id="telephone" placeholder="Please provide your contact number" name="Phone" required>
               </div>
              <div class="left">
              <input id="email" placeholder="Email Address" name="Email" required>
             </div>
              </div>
              <div class="row">
                            <div class="left">
                                <div class="styledselect">
                                  <select style="width:400px; color: #898888; height: 42px;" tabindex="2" name="Subject" id="Subject">
                                    <option value="select">What can we help you with? Click to select an option.</option>
                                    <option value="website comments">New Website Comments</option>
                                    <option value="ordering">Ordering</option>
                                    <option value="order status">Order Status</option>
                                    <option value="csos">CSOS Setup</option>
                                    <option value="payments credits">Payments &amp; Credits</option>
                                    <option value="contact account manager">Contact My Account Manager</option>
                                    <option value="email list">Join Email List</option>
                                    <option value="monthly newsletter">Sign Up For Monthly Newsletter</option>
                                    <option value="rewards">Auburn REWARDS Free Goods</option>
                                    <option value="reset password">Reset User ID/Password</option>
                                    <option value="questions">Questions</option>
                                    <option value="suggestions">Suggestions</option>
                                    <option value="other">Other (Please Specify)</option>
                                  </select>
                                </div>
                                <!-- end select style-->
                </div>
              </div>
              <div class="commentbox">
                                  <div class="left">
                                    <textarea id="styled" placeholder="Please type your message here" name="Comments" required></textarea>
                                     </div>
              </div>
              <div class="row">
                                  <div class="left">
                                  <input type="image" src="images/contact_submit.png" name="submit" width="85" height="38" id="submitbutton">
                </div>
              </div>
                       <div class="row">
                        <div class="left required"><em>*All fields are required.</em></div>
              </div>
            </form>
    <script>
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {validateOn:["change"]});
    </script>
    </body>
    </html>

    That's what is driving me crazy. The code appears correctly.  The DOCTYPE is:
    <!DOCTYPE HTML>
    I've attached a screenshot of the page once it loads without submitting the actual form and the spry settings in Dreamweaver.
    Thanks!

  • InDesign crashing when running script on large files

    Hello,
    I have created a javascript that will:
    For each InDesign file inside of a specified directory {
    Open the file
    Find all textual elements with the specified character style
    Convert that textual element to a hyperlink
    Export the file to PDF (with a specified export preset)
    Close the document
    The script is working great. However, the script will cause InDesign to crash if it encounters a file with a larger file size.  The script works fine with InDesign files that are less than 50 - 60 MB.  When it hits a filesize that is any larger, InDesign will crash. I am running InDesign CS5.
    Does anyone have any recommendations?
    Thanks!

    I figured out my problem:  I had a block of code in my for loop (which converts all character styles of a given name to hyperlinks) which would set the hyperlink styling properties.  For some reason, this code would crash InDesign when dealing with larger InDesign documents.  I deleted this block of code from my script.
    Here is the code block:
    for(/* looping through the active document */){      .     .     .      ++hyperlinks;
         with(hyperlink) {
              highlight = HyperlinkAppearanceHighlight.none;
              borderStyle = HyperlinkAppearanceStyle.solid;
              visible = false;
              name = foundTexts[i].contents + " :" + id;
    Thanks for everyone's suggestions!

  • Side menu text color

    Hello Muse folks... new at this and I'm working with the template i purchased Muse Templates - Wide | Adobe Muse Template | ThemeForest. If you go to the live veiw and scroll down there will be a menu that appears on the left side. I was able to change the icons in the muse program but i do not see where I can change the text color for hover and click, etc. I also want to change the logo image above but I'm not sure where that's located either. This is my first time to use the program so any assistance would be greatly appreciated. Thank you... smiles!

    Hi Mark,
    You need to go under, "file -> site properties -> content" to change the hyperlink styling. Check the screen shot below.
    And for the logo above check the master page that is applied to the home page and see if you able to locate it there.
    - Abhishek Maurya

  • What's your favorite of styling hyperlinks?

    Hi,
    what's your favorite way of styling hyperlinks?
    Right now I've colored mine C=100 M=100 Y=0 Y=0 and made them underlined. I feel the underlining is a bit too harsh on my overall design. Then again if I don't underline them, how are people suppose to know they're links?
    Spelling out URLs is just not an option. Unless I use TinyURL? They say their links will last forever but who knows for sure?

    That is a question about cultural expectations -- I can't answer that confidently.  The check mark that so often is used in US software to signal 'OK' (as in the spelling checking function where I edit this message) signals 'Error' to me -- and when it is shown in green (as Borland Software did at one point, and as Adobe does here) it signals both 'Error' and 'OK', and produces a kind of 'pulling-both-ways' effect that isn't too pleasant -- to me. I'm not sure I can come up with something that works for you.
    The dialog bubbles may work -- though to me the carry overtones of a footnote or an endnote. But they pretty clearly seem to signal 'more info elsewhere', and that's definitely a step in the right direction.
    I would be looking for something like a bent arrow -- perhaps Unicode U+21AA (↪), or perhaps something similar with a double arrow (Unicode U+21D2, ⇒), except I'd like it to have a similar curve at the left, half suggesting a 'click here to go elsewhere'. (Wingdings 3, character code 0xCA, is close.) But I could probably go for 0x58 in WIngdings 3, rotate it 90 degrees to the right, and perhaps tweak the small box into two smaller boxes of unequal size, suggesting movement.
    Or perhaps just something that suggest a 'click here' -- some of the simpler designs in Altemus Bursts, or Altemus Pinwheel or Altemus Stars might work.
    I would like something that tempted the reader into testing, and so encourage learning-by-doing. That would be helped by a similar symbol going the other way to indicate the 'back' of a web browser.  Arrows help here -- they show a direction. Other designs -- bursts -- won't be a easily understood: what would be a reverse burst?.And what symbol would be used at the target end of the dialog bubbles to suggest 'go back'? (Added: perhaps a quad or square signalling 'end'?)
    Arrows seem safer. Even guillemets might work, as long they won't be misread as quotes of some kind. Guillemets in a circle? There are some such glyphs like that in Wingdings. The standard 'fast forward' and 'fast backward'  glyphs (in Webdings, say) may also work.
    Actually ... this is the kind of problem I'd might want to suggest for a small project for a class for typeface designers.

  • Styling within TextArea

    I have been doing the lessons in the tutorials that came with
    Flex Builder 2, and have fiddled with the BlogReader sample to
    create a version of the BlogReader that reads the RSS of my own
    blog:
    http://jamesedmunds.com/Flex/BlogReader.cfm
    My question has to do with styling
    within the TextArea below the grid, where individual
    postings are displayed. How would I style this, so that, for
    instance, the anchors (links to
    http:// addresses, in this case) showed in blue
    (and even changed on hover)? Is this possible?
    Thanks in advance,
    James

    I can get the textArea to take the styles passed in through a
    stylesheet, but not take the <a> styles.
    Here is what is in my stylesheet:
    A:link {color:#333300;
    text-decoration:underline;}
    A:active {color:#333300;
    text-decoration:underline;}
    A:visited {color:#333300;
    text-decoration:underline;}
    A:hover {color:#c00000;
    text-decoration:underline;}
    TextArea
    {font-family:Georgia;
    font-size:14px;
    color:#000000;
    The text in the textArea displays in 14px Georgia as
    indicated, but the <a> tags do not take the propoerties at
    all... the only indication that they are links is that the cursor
    changes to the pointing finger when hovered over them.
    Thanks in advance for any help,
    James

  • CC hyperlinks and styling  individual divs

    I would like to style my hyperlinks depending on the div background colors. I read the  tutorial on psuedo classes but didnt quite undersatnd how to apply it In CC. I copied some info from the tutorial into my stylesheet. Below is a portion of the stylesheet mystyles.css. How would I apply the changes for each div so that they override the settings in page properties. All pages descend from a template page. website can be seen at www.eastsidesedationdentistry.com
    /* Special Rules for Desktops */
    @media only screen and (min-width: 1000px) {
         body {font-size: 100%}
    .gridContainer.clearfix #sidebar div img {
              padding: 10px;
    .gridContainer.clearfix #sidebar div img {
    #website {display:none;
    .maincontent a:link {
              text-decoration: underline;
              color: #FFCC00;
    .maincontent a:visited {
              text-decoration: underline;
              color: #FFCC00;
    .maincontent a:hover {
              text-decoration: none;
              color: #CCCCCC;
              background-color: #333333;
    .maincontent a:active {
              text-decoration: underline;
              color: #FFCC00;
    Thanks
    Andrea

A: CC hyperlinks and styling  individual divs

A.Cambria wrote: Can I assign multiple classes to the same div?  Currently I have  <div id=" main content" class='fluid" >  What is the correct syntax to add the class "row" Can you also explain how to add the .row info to the external style sheet
The class of "row" was just an example - you don't need this unless of course you want to. To create a general style for all links regardless of where they are on the page, you simply add the below to your stylesheet:
a { /* styles here */ }
a:visited, a:active { /* styles here */ }
a:hover { /* styles here */ }
If you want to only color the links within #maincontent, you would add the below to your stylesheet (this would go further down your stylesheet than the above reference):
#maincontent a { /* styles here */ }
#maincontent a:visited, #maincontent a:active { /* styles here */ }
#maincontent a:hover { /* styles here */ }
The div you specified in your message has an id, not a class.
.maincontent styles class="maincontent" in the HTML
#maincontent styles id="maincontent" in the HTML
You can add multiple classes to divs, but not multiple id's. Just separate them by a space.
<div class="maincontent row"></div>

A.Cambria wrote: Can I assign multiple classes to the same div?  Currently I have  <div id=" main content" class='fluid" >  What is the correct syntax to add the class "row" Can you also explain how to add the .row info to the external style sheet
The class of "row" was just an example - you don't need this unless of course you want to. To create a general style for all links regardless of where they are on the page, you simply add the below to your stylesheet:
a { /* styles here */ }
a:visited, a:active { /* styles here */ }
a:hover { /* styles here */ }
If you want to only color the links within #maincontent, you would add the below to your stylesheet (this would go further down your stylesheet than the above reference):
#maincontent a { /* styles here */ }
#maincontent a:visited, #maincontent a:active { /* styles here */ }
#maincontent a:hover { /* styles here */ }
The div you specified in your message has an id, not a class.
.maincontent styles class="maincontent" in the HTML
#maincontent styles id="maincontent" in the HTML
You can add multiple classes to divs, but not multiple id's. Just separate them by a space.
<div class="maincontent row"></div>

  • TextArea with formatted Text, Hyperlinks, and clickable Text with SWING?

    Hi again,
    Ok if I decide to use Swing, is there any TextArea which supports Formatted Text Hyperlinks AND clickable Text wich calls a callback routine??? I think formatted Text and Hyperlinks are possible with JTextArea and the RTF editorKit, but clickable text, in order to controll the program in some way???
    Could anyone help me?
    Greets

    Try the JEditorPane class.See the intro exapmle at the top of
    [url=http://java.sun.com/j2se/1.4.2/docs/api/javax/swin
    /JEditorPane.html] this page.That seems to be the solution! Can I use the JTextPane, too? Does a DefaultStyledEditorKit support Hyperlinks and Hyperlinklisteners, too?
    In order to realize callback functions I have to insert a HTML-Anchor with the Attribute as the Parameter for my method. Then my HyperlinkListener catches the HyperlinkEvent and the hyperlinkUpdate method reminds the parameter!
    Is that right?
    Thank you very much!
    Greets

  • Flex Mobile textArea styling the text?

    I've read in several documents about TLF not supported in Flex Mobile. I then read about text fields vs textArea and css Style sheets.
    I'm trying to keep this really simple 1. cause I'm learning 2. So I can build on best practices 3. I'm still learning....
    Example:
    Main
    <?xml version="1.0" encoding="utf-8"?>
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView"
      creationComplete="creationCompleteHandler(event)">
    <fx:Script>
      <![CDATA[
       import mx.events.FlexEvent;
       [Bindable]
       private var xmlInfo:XML;
       import mx.rpc.events.ResultEvent;
       protected function info_resultHandler(event:ResultEvent):void
        xmlInfo = new XML(event.result.text);← I want to say this is where I need to tell Flex how to interprit the incoming text format.
       protected function creationCompleteHandler(event:FlexEvent):void
        infoXML.send();
      ]]>
    </fx:Script>
      <fx:Declarations>
       <s:HTTPService id="infoXML" url="assets/data.xml"
             resultFormat="e4x"
             result="info_resultHandler(event)"/>
    </fx:Declarations>
      <s:TextArea id="spInfo" text="{xmlInfo}" width="100%"/>
    </s:View>
    data.xml
    <?xml version="1.0" encoding="utf-8"?>
    <info>
    <text><![CDATA[<b>Bold</b>Not bold<font face="Arial">Arial text</font>Not Arial
    ]]>
    </text>
    </info>
    Mobile app output
    <b>Bold</b>Not bold<font face="Arial">Arial text</font>Not Arial
    Thank you in advance.

    > How do you mean with the borders Murray? I've never had
    any trouble that
    > I'm
    > aware of? Isn't it fairly common for textfields in forms
    to have a box
    > round
    > them?
    Some browsers (Safari comes to mind) won't do borders at all,
    and others (I
    don't recall which) can actually get surly when you try. I
    don't recommend
    that you try to style form elements to that level.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Iain71" <[email protected]> wrote in
    message
    news:f9up7e$9u1$[email protected]..
    > Cheers - font-family - of course. Think it threw me when
    I typed font :
    > and got
    > the drop down menu.
    >
    > How do you mean with the borders Murray? I've never had
    any trouble that
    > I'm
    > aware of? Isn't it fairly common for textfields in forms
    to have a box
    > round
    > them?
    >
    > Or is there a better method I could be using?
    >

  • TextArea styling htmlText

    Hi,
    How can I style my html content of a TextArea? I tried it
    like this but it keeps throwing errors:
    var h1:Object = new Object();
    h1.fontFamily = "DistrictThin";
    h1.color = "#FFCC00";
    h1.fontSize = 30;
    h1.leading = 15;
    h1.display = "block";
    var css:StyleSheet = new StyleSheet();
    css.setStyle("h1",h1);
    var styledTxt:TextArea = new TextArea();
    styledTxt.width = textBox.width;
    styledTxt.height = textBox.height;
    textBox.addChild(styledTxt);
    styledTxt.styleSheet = css;
    styledTxt.htmlText = '<h1>Lorem
    Ipsum</h1><p>dolor sit amet dolor sit amet dolor sit
    amet</p>';
    Error: Error #2009: This method cannot be used on a text
    field with a style sheet.
    at flash.text::TextField/set defaultTextFormat()
    at mx.core::UITextField/set
    htmlText()[C:\dev\GMC\sdk\frameworks\mx\core\UITextField.as:314]
    at
    mx.controls::TextArea/mx.controls:TextArea::commitProperties()[C:\dev\GMC\sdk\frameworks\ mx\controls\TextArea.as:1787]
    at
    mx.core::UIComponent/validateProperties()[C:\dev\GMC\sdk\frameworks\mx\core\UIComponent.a s:5218]
    at
    mx.managers::LayoutManager/mx.managers:LayoutManager::validateProperties()[C:\dev\GMC\sdk \frameworks\mx\managers\LayoutManager.as:517]
    at
    mx.managers::LayoutManager/mx.managers:LayoutManager::doPhasedInstantiation()[C:\dev\GMC\ sdk\frameworks\mx\managers\LayoutManager.as:658]
    at Function/
    http://adobe.com/AS3/2006/builtin::apply()
    at
    mx.core::UIComponent/mx.core:UIComponent::callLaterDispatcher2()[C:\dev\GMC\sdk\framework s\mx\core\UIComponent.as:7789]
    at
    mx.core::UIComponent/mx.core:UIComponent::callLaterDispatcher()[C:\dev\GMC\sdk\frameworks \mx\core\UIComponent.as:7732]
    at flash.utils::Timer/flash.utils:Timer::_timerDispatch()
    at flash.utils::Timer/flash.utils:Timer::tick()
    Thanks!

    I'm having loads of problems figuring out how to put CSS in a
    Label. I try to just put the css in the actual html:
    <mx:Label x="0" y="0" width="100%">
    <mx:htmlText><![CDATA[<style
    type="text/css">h1{font-weight:bold}</style><h1>Header
    Text</h1>]]></mx:htmlText>
    </mx:Label>
    But this doesn't work at all. I'm using the 2.0.1 SDK. How do
    I apply CSS styles to the html elements?

  • Can i make a Hyperlink in a TextArea?

    I want to make a link to a picture..or another form or file in a TextArea
    is it possible?
    if so how?

    http://java.sun.com/docs/books/tutorial/uiswing/components/text.html

  • How to make hyperlinks in JTextField/JtextArea  ??

    My JTextField/JtextArea has got this Text.
    String text = "Get information from http://www.hotmail.com, if you have problems go to http://www.google.com " ;
    How to make hyperlinks for http://www.hotmail.com and http://www.google.com texts only???
    And how to call those sites???

    Add a mouse listener, when the user double clicks - see if they've clicked on text that is a valid link.
    The limitation of using textfield or textarea is that you get no styling. I dont know why you're refusing those suggestions, but you're just creating more work for yourself.

  • Maybe you are looking for

    • Dual booting arch (usb) and ubuntu (grub2)

      Greetings, I'm trying to dual boot Arch linux (installed without a bootloader on a USB SSD) and Ubuntu 10.04 (installed on a hdd with GRUB2) but can't get Arch to boot. (Oh and I already have windows dualbooted) The entry grub autogenerated: menuentr

    • ADF security : JAZN-LDAP

      Hi, We are working on the development of an application with Oracle ADF (JDev 10.1.3). We implemented security with lightweight XML provider and it's working perfectly. Next month we will deploy our application and so we will use a LDAP server. Is it

    • Can't I use my wireless mouse and trackpad in different ways when scrolling?

      Since I'm a Chinese user, I prefer describing my question in my mother language...I will translate it... 在系统偏好设置里,倒是可以分别设置鼠标和触控板,但是当我打开触控板的“自然滚动”,同时取消鼠标的“滚动或导航时,使内容按手指方向移动”,之后,鼠标恢复原来的滚动 方式,郁闷的使触控板的滚动方式也跟着变化了⋯⋯ 但这时打开触控板的设置,“自然滚动”依然是选中的啊⋯⋯ 如果这时关闭“自然滚动”

    • Using IN with two columns

      Hi all, I have to perform a query like x,y not in(select x,y from k). How to do this. These two columns are composite primary keys in both tables although no references exists. A sample table and expected result. create table v(name varchar(10),place

    • My iphone will not sync, says 'iphone did not sync because sync failed to start'

      I downloaded an update last night that took about 3+ hours (maybe it's just my computer?) and when I unplugged my iPhone, all my apps were gone.  Am trying to sync it and it's telling me the 'sync failed to start'.  Please help!!