Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formating text in ASP with CSS

Status
Not open for further replies.

MonicaX

Technical User
Jul 13, 2002
35
US
I'm not an asp programmer, so don't mock me. I am working with one however, who usually says "It can't be done" without giving it much thought. Sometimes he proves to be right, other times not. My question is, can you apply CSS to text generated with whatever this code does?

"Label.Value = "Hello World"

or

response.write Replace(HTMLTemplate.GetHTML("main"),"</body>","<center><font face=""Arial""><small>Text Goes Here</small></font></center></body>")

Thanks,

Monica

 
Why not... IF text serves only for printing (response.write) and nothing much else. That's why programmers always rant about "mixing data and presentation". Here is (still ugly) example:
Code:
response.write Replace(HTMLTemplate.GetHTML("main"), "</body>", "<div style='text-align: center; font-family: Arial; font-size: small;'>Text Goes Here</div></body>")
 
I see what you mean. I can see how you can format with HTML, but can you link text to style sheets? Like the Label.Value thing where I'm guessing is how you print varying text from a database or something -- can you link that to a style sheet?

Thanks
 
I tried this, wich I thought might work -- no dice. Any ideas? The positioning works, but not the font attributes. Some kind of syntax problem that conflicts with asp?

<div id="Layer1" style="position:absolute; left:78px; top:122px; width:196px; height:128px; z-index:1" class="StyleNameHere">{Label}</div>
 
vongrunt,
It's pretty dumb to reply to yourself twice, I know. But I've aswered my own question. I can just apply the CSS to a cell (duh!)then have the text flow in to that. It's messy I know but you can put the cell in a div and move it anywhere. Problem Solved.

Thanks for helping me think it through.

Monica
 
Feel free to post any other "Is it posible" type questions, there is a bunch of us that would have a lot of fun with them and look forward to seeing questions like that, often the more impossibl sounding the better :)

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
The never-completed website:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top