View Full Version : Adding more than one style to a textarea

08-31-2009, 02:50 PM
Hi there

I am new to using a textarea and im not even sure if that is the correct option for what I want to do! I have designed a small website for my Dad's business and I wanted to put some scrollable text onto one of the pages. Is textarea the best option for this???

If textarea is the best option then my main problem is adding styles to it. I am using Dreamweaver MX and I have easily added one style to my text however I cant seem to add more than one style to it... If this is possible what code do I need to enter and where should I put this code???

Many thanks and I look forward to your replies!!!


08-31-2009, 02:54 PM
A text area is a form element and probably shouldn't be used for this purpose. You really want a normal div with a specified height i.e. height: 300px; and then the property overflow: scroll; which will force scrollbars to appear when the content is longer than the height allows.

Seeing as the text will then be in a plain old div you can apply as many styles to it as you like using span tags.

Hope this helps.

08-31-2009, 03:04 PM
Thanks for the quick response and help with that! Im just having a go at that now and will let you know if im still stuck!!!

Thanks again


08-31-2009, 03:18 PM
Ok I am stuck!!!

This is what I have got which is basically a table I have made in the original website design which is inside a table and inside another table. Where do I need to put my code in the below???

<td width="631" valign="top"><table width="631" border="0" align="center" cellpadding="15" cellspacing="0">
<td width="601" align="left" valign="top">

08-31-2009, 03:23 PM
Please don't take this the wrong way but you are stuck because you are using tables and inline styles. You should be building your website with divs and CSS. The div will hold the text, for example;

<div id="scrolling">Your Text Here</div>

and then create a style in a separate stylesheet something like;

#scrolling {
overflow: scroll;
height: 300px;
width: 600px;

You have some more research to do before you crack this one.

08-31-2009, 03:27 PM
Okey doke! Thanks for the help, this is starting to make more sense now :) What I will do is practice building something simple from a new page using divs and CSS and see how I get on! I had no idea that using tables would cause any issues!!!

Thanks again


08-31-2009, 03:32 PM
Wow, thanks for not kicking up a fuss. Most people react quite badly to that news first time round!

Read the FAQs for starters...


We will help you out all we can. Good luck :)

08-31-2009, 03:54 PM
Well you can't learn how to do something properly if you don't give other peoples advice a try :)

So that you can get an idea of what I am working on take a look at the site so far. It's the profile page im working on.

I know it's a long web address but hollanddigitalcreations was originally just for me but then my Dad and brother wanted to be put on the same name!

Thanks again and I hope you like it


08-31-2009, 04:07 PM
The design itself is very nice. Good work :) You need to look at a few things. Rebuilding your pages with CSS and divs as I mentioned earlier. Leave off the 'save as HTML' option in Photoshop as it will only lead to issues down the road.

You need to specify a doctype in your page header or older browsers could render the page incorrectly.

You should also not use spaces in file names. See how the link you have posted has put '%20' in your page address? This is because it has seen a space and added that text. This can also cause you problems.

You certainly have an eye for design but now you need to get the 'nuts and bolts' of website construction down as well.

My wife is from Dorset!

08-31-2009, 04:13 PM
Oh it's a small world!!!

Thanks for the advice! I will certainly work on the issues you have described and maybe eventually get around to building it again but without all the tables!

Again thanks for all the tips and advice

Jo :)