 |
| HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

May 31st, 2004, 10:40 AM
|
|
Authorized User
|
|
Join Date: May 2004
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Textarea problem
Hi,
How does one modify the font etc. in a text area.
I want to display bold italic etc. however I do not want to use one of those editors as they will display the formating buttons which i dont want.
I simply want a static text area with different font colors and sizes. Thats all - nothing else Any idea to how to go about doing this?
Your help is greatly appreciated.
|
|

May 31st, 2004, 10:47 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
try this...
Code:
<html>
<head>
<style>
TEXTAREA { font-family:verdana; font-weight:bold; }
</style>
</head>
<body><textarea>some text</textarea></body>
</html>
Hope it helps
Jacob.
|
|

May 31st, 2004, 11:24 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
What do you mean you want to display bold/italic/underline without formatting buttons?
HTH,
Snib
<><
|
|

May 31st, 2004, 11:40 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
OK, I guess I misunderstod. You are talking about these editors used in e.g. this forum, and you do not like the buttons, so you want a way to do it without the buttons, right?!
I think you have to make the question more detailed.
Jacob.
|
|

May 31st, 2004, 12:49 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
|
|
This isn't possible with a textarea field. Only one style can be set for the entire field. You're going to need a crapload of javascript and something like overflow: auto; to emmulate a <textarea> on a <div> element, whereas you can edit to your heart's delight, adding features for bold, italic, font size etc (although I don't know how you intend to do this without buttons?). Its a pretty large project and quite outside the scope of P2P. I'd do some googling for WYSIWYG editors.
http://www.google.com/search?q=WYSIWYG+JavaScript
If you've noticed P2P itself only uses BBcode and a textarea field to accomplish this.
Many solutions available are microsoft IE only solutions, but it is possible to code a cross-browser WYSIWYG editor, and even without an <iframe>.
HTH!
Regards,
Rich
::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
|
|

June 2nd, 2004, 06:51 AM
|
|
Authorized User
|
|
Join Date: May 2004
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Guys,
Thanks Richard. Maybe I am on the wrong track.
Basically, I need to fit a lot text with pictures and other graphics into a small area. This what I need.
So I thought that a scrollable textarea would be good. However, as you say the project is too much work, can you recommend me any other solutions to go about doing this?
Thanks a bunch
|
|

June 2nd, 2004, 10:56 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
Textareas (and our suggestions) are editable. Do you want that?
If not, you can put HTML in a <div> and set the overflow property to scroll.
....
<div style="overflow:scroll">
your images, any HTML stuff
</div>
....
HTH,
Snib
<><
|
|

June 7th, 2004, 10:07 AM
|
|
Authorized User
|
|
Join Date: May 2004
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hey Guys,
Found a way using <iframes> however now I am stuck on another problem. How does one remove the horizontal scrollbars on <iframes>. I seem to have tried various codes like
body { overflow-x:hidden; }
but none of them seem to work.
Any suggestions..?
|
|

June 8th, 2004, 12:29 AM
|
|
Authorized User
|
|
Join Date: May 2004
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hey everyone,
I found a way by setting the body width of the source page to 95%. Problem solved.
body { width=95%; }
Thanks for all your support.
|
|
 |