Click to See Complete Forum and Search --> : CSS style for IFrame???


gavC
06-30-2003, 04:53 AM
Hi all,

I am having great difficulty in setting a CSS style for an element in my IFrame. I know how to set the stylesheet for the IFRame using the function "createStyleSheet(strCSS);", however, I want to be able to set the stylesheet for the line that I am currently adding text. This would be like clicking on 'Bold' in Microsoft Word and having the ability to write text using this font until I click on the button again to turn it off.

I know that there is an execCommand function that I can use to execute commands on the IFrame. However, I can not find a command identifier that will allow me to set the css style for my current position.

Has anyone come across this problem before?!? Any help would be greatly appreciated!

Cheers,
gavC

Jonathan
07-05-2003, 07:14 PM
Couple of things:

You should use plain html...
Do you have a link that would display, or a script?

-----------------------

An IFRAME is another page being displayed in another... so, if you wanted to use CSS for the IFRAME page you should put a link like this onto the page:
<LINK REL=sytlesheet HREF="your_page.css" type="text/css">

Then you should create your stylesheet in a document with the name of: your_page.css. That should end your problems.

---What is it you are looking for again?---
---Can you tell me what you want on your page exactaly?---

Jonathan
07-05-2003, 07:18 PM
I am sorry, I miss-read your post... :)

So you want a button that would change the text... ok...

you will have to wait for my buddy Charles to answer this one... :)

Jona
07-06-2003, 12:47 AM
Perhaps, you mean something like what is used in Yahoo! Mail? If so, you have lots of scripting to do... :rolleyes:

[J]ona

Aronya1
07-06-2003, 11:09 AM
Hi guys,

I'm pretty new to CSS & haven't used Iframe yet, but wouldn't it be simple enough to use a <span> tag & add the desired properties in-line? gavC says he trying to affect only a line of text...

Someone please correct me if I'm wrong.

Aronya1

Jona
07-06-2003, 02:23 PM
Well, apparently, it's not all that important to gavC, since he hasn't replied back yet. :rolleyes:
Anyways, since he didn't really help us figure out what he needs, it's difficult to know. We all could think of different things, but a lot of the time it's something that no one "thought of" off the top of their heads. So, until he replies, we probably won't know what he wants--that is, if he replies.

[J]ona

Aronya1
07-06-2003, 08:22 PM
Jona,
Am I right, though? Would the <span> tag work if all he wants to do is edit a line of text? Iframes are like using HTML frames, right?

Jona
07-06-2003, 08:49 PM
Yes, what you said is correct. However, you shouldn't substitute a DIV for a SPAN, because a SPAN is not a block-level element, it must be contained in a block-level element.

[J]ona

Aronya1
07-06-2003, 08:54 PM
Got it. I was just thinking in terms of what was originally posted. He said he was editing text.