# External text loads but CSS won't style

**URL:** <https://forum.kirupa.com/t/external-text-loads-but-css-wont-style/294113>\
**Category:** Uncategorized\
**Created:** [August 8, 2009, 7:01pm UTC](https://forum.kirupa.com/t/external-text-loads-but-css-wont-style/294113 "2009-08-08T19:01:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![adlib33](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@adlib33](https://forum.kirupa.com/u/adlib33)\
**Post date:** [August 8, 2009, 7:01pm UTC](https://forum.kirupa.com/t/external-text-loads-but-css-wont-style/294113/1 "2009-08-08T19:01:13Z")

</div>

Can’t get the CSS to style an external txt. Copy loads as supposed to and thru a trace I can see that the css stylesheet is recognized but it won’t actually style the text. For instance, \<span class=“header”\> Heading\</span\>stays at the original font size instead of getting bigger. I’m stumped. Have tried so many things to get this to work. What have I missed?

Instance name of dynamic text field = upcom\_txt. Text field is on stage. Html, check. Multiline, check.  
the css style sheet = “CSSs/news.css”  
my text = “TXTs/upcom.txt”  
Font = “Alte Haas Grotesk”. The font is a font symbol exported from the library of the FLA. (I’ve tried using a system font, but it still doesn’t work)

CSS FILE:

```auto
p {
  color: #ffffff;
  font-size: 12px;

}

a:link {
  color: #000000;
  text-decoration: underline;
}

a:hover{
  color: #999999;
  text-decoration: none;
}

.header {
  color: #FFFFFF;
 
  font-size: 20px;
  font-weight: bold;
  display: block;
}

.subhead {
  color: #666600;
 font-style: italic;
font-size: 16px;
  font-weight: bold;
  display: inline;
}

```

AS CODE on timeline to load stylesheet first and then upcom.txt:

```auto

function cssLoadComplete(event:Event):void
{
        styles.parseCSS(event.target.data);
        // Now assign the StyleSheet to a text field for example
		
        upcom_txt.styleSheet = styles;

        // Now you would load any external text or html into
        // the text field
		function textLoadComplete(event:Event):void {

			upcom_txt.htmlText = textLoader.data;
		}

		var textLoader:URLLoader = new URLLoader();
		var textReq:URLRequest = new URLRequest("TXTs/upcom.txt");

		textLoader.load(textReq);
		textLoader.addEventListener(Event.COMPLETE, textLoadComplete);

}

var cssLoader:URLLoader = new URLLoader();
var cssRequest:URLRequest = new URLRequest("CSSs/news.css");
var styles:StyleSheet = new StyleSheet();

cssLoader.load(cssRequest);
cssLoader.addEventListener(Event.COMPLETE, cssLoadComplete);
}

```

Text file:

```auto
<span class='header'>First announcement</span>
<span class='subhead'>This is a subhead for URLS and such</span>
<p>This is where we will show off a bunch of announcements in blog format. This is where we will show off a bunch of announcements in blog format. This is where we will show off a bunch of announcements in blog format.This is where we will show off a bunch of announcements in blog format.This is where we will show off a bunch of announcements in blog format </p> 

```

Anyone see why there would be a problem?:ear: Thank you in advance. I’ve really appreciated the help.
