# Formatting dynamic textfield with CSS - problem

**URL:** <https://forum.kirupa.com/t/formatting-dynamic-textfield-with-css-problem/238673>\
**Category:** flash\
**Created:** [September 13, 2007, 8:13pm UTC](https://forum.kirupa.com/t/formatting-dynamic-textfield-with-css-problem/238673 "2007-09-13T20:13:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TylerNZ](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/tylernz/32/415_2.png) [@TylerNZ](https://forum.kirupa.com/u/TylerNZ)\
**Post date:** [September 13, 2007, 8:13pm UTC](https://forum.kirupa.com/t/formatting-dynamic-textfield-with-css-problem/238673/1 "2007-09-13T20:13:53Z")

</div>

Ok, so I have a dynamic textfield and I have css applied to it, it works fine.  
HOWEVER, when I add some styles (some margin) it’s ignoring them! agh.

[AS]var newStyle:TextField.StyleSheet = new TextField.StyleSheet();  
newStyle.setStyle(“a:link”, {color: ‘#BED57B’, fontWeight: ‘bold’});  
newStyle.setStyle(“a:hover”, {color: ‘#F09A61’});  
newStyle.setStyle(".images", {marginRight: ‘60’});  
newStyle.setStyle(".mytest", {marginLeft: ‘100’});  
pro\_text.styleSheet = newStyle;[/AS]

[AS]pro\_text.htmlText = “\<img src=‘images/1-overview.png’ class=‘images’ hspace=‘0’ vspace=‘3’/\>\<p class=‘mytest’\>This is a test paragraph.\<br/\>\</p\>\<p\>And another test paragraph here.\<br/\>\</p\>\<p\>\<a href=‘pdfs/mypdf.pdf’\>My Test PDF\</a\> (pdf)\</p\>”;[/AS]

Any ideas?
