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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

varying colours inside textarea? 1

Status
Not open for further replies.

wiredsc

MIS
Feb 27, 2006
5
GB
basically i have a text area that is just for displaying news articles, which I want to load in externally (.txt/.php). I wish to have parts of the text in bold and in different colours.

To do this I have written all the text in html, however i can't figure out how to load the text in externally and also it appears text areas do not read html.

Is there a better way of doing what I'm aiming to do? I am relatively new to Dreamweaver however I am always up for a challenge.

Thanks.
 
How about not using a textarea?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Thats fine, I just don't know where to start to create something similar, I only have a limited space so will need a scroll bar.
 
use a [tt]div[/tt] or a [tt]p[/tt]. style them appropriately.



*cLFlaVA
----------------------------
spinning-dollar-sign.gif
headbang.gif
spinning-dollar-sign.gif

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Okay... my mate has been mentioning this, I have this script:

<div style="background-color:#4C3A27; font-size: 11px; color: #FFFFFF; border-style:solid none solid none; border-color:#FFFFFF; border-width:thin; padding:0.5em 0.5em 0.5em 0.5em; font-family: Arial; overflow:scroll; overflow-x:hidden; width:100px; height:100px;">
<pre style="white-space: -moz-pre-wrap;white-space: -pre-wrap;white-space: -o-pre-wrap;white-space: pre-wrap;word-wrap: break-word;">all my html text</pre></div>

This works, the only problems are that netscape doesn't recognise the 'overflow-x:hidden' part of the css so i end up with a big white rectangle at the bottom of the textfield. But the main problem is that Dreamweaver has doesn't seem to recognise the width and height measurements in the css and so fills my page with all my text and borders which knackers up my whole page layout. Its fine in the browser though
 
What do you actually want the end result to look like?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
ok, I would like the end result to be a like a text area with a scrollbar down the side however the text inside the text area will have varying formats inside, for instance it will have:

27.02.06 - Welcome!
welcome to the new site, blah blah blah

The date will be green, the title will be white in bold, and the text will just be white.

Ideally I would like something like that, where the format is done using html, and I can load the text externally so I don't have to open my html file everytime I want to update.
 
In it's simplest form then, if you use "overflow: auto", you could use a paragraph tag as was suggested above e.g.
Code:
<style>
#myText
{
    overflow:auto;
    width: 400px;
    height: 100px;
}
</style>
Code:
<p id="myText">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris ut turpis volutpat diam scelerisque euismod. Praesent purus turpis, adipiscing ac, interdum nec, fringilla vitae, mi. Pellentesque nec tellus. Quisque augue. Suspendisse ac est eget nibh fermentum blandit. Donec id lorem. Vivamus varius neque vel lectus. Sed semper pellentesque tellus. Nulla elementum purus quis dolor. Fusce facilisis eros nec erat. Etiam laoreet, nibh ultricies porta dictum, lacus tortor aliquet arcu, sit amet luctus massa arcu nec tellus. Phasellus eget lorem. Mauris dapibus nibh ut lorem. Aliquam tempor dictum massa. Nullam auctor odio eget lectus. Phasellus tristique gravida dui.</p>


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Excellent!

Thanks very much, I don't know why I couldn't fit my head around that the first time.

rearranging it has done the trick, much appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top