The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

How to add font and font color in posting body (messages)?

3 posters

Go down

How to add font and font color in posting body (messages)? Empty How to add font and font color in posting body (messages)?

Post by Claudia November 26th 2008, 4:57 am

Hi, I just added a font in the template posting body (Messages posting) and then I wanted to add a new color. That's where it went wrong Crying or Very sad

The color didn't work and the font (monotype corsiva) that was added and working fine disappeared. Now I can add a font or a color but it doesn't show on the forum.

What am I doing wrong???

I'm working with phpbb2 and this is what I want to add:

Code:
<button style="color:grey;" onclick="bbfontstyle('[color=grey]', '[/color]');selectWysiwyg(this, 'color');return false;" onmouseover="this.className='selectHover';" onmouseout="this.className='';">{L_COLOR_GREY}</button><br />

and

Code:
 <button style="font-family:'Monotype Corsiva';" onclick="bbfontstyle('[font=Monotype Corsiva]', '[/font]');selectWysiwyg(this, 'font');return false;" onmouseover="this.className='selectHover';" onmouseout="this.className='';">Monotype Corsiva</button><br />

I hope someone can help.
avatar
Claudia
Forumember

Posts : 37
Reputation : 0
Language : Dutch
Location : The Netherlands

Back to top Go down

How to add font and font color in posting body (messages)? Empty Re: How to add font and font color in posting body (messages)?

Post by Gunhack X November 26th 2008, 8:43 am

I will test this right now. Please be patient and wait for my next reply.

Best Regards
Gunhack X
Gunhack X
Gunhack X
Forumember

Male Posts : 479
Reputation : 14
Language : English, Español
Location : USA

http://windows.topgoo.net

Back to top Go down

How to add font and font color in posting body (messages)? Empty Re: How to add font and font color in posting body (messages)?

Post by Gunhack X November 26th 2008, 9:45 am

Ok, I am done and ready to guide you.

First, your font code is Ok. PASS
Second, your color code is WRONG. NO PASS
Reason: Incorrect code.

Now, I will tell you how to fix your color code:

Well, here is your current code: (I have marked the bad code part with red)
<button style="color:grey;" onclick="bbfontstyle('', '');selectWysiwyg(this, 'color');return false;" onmouseover="this.className='selectHover';" onmouseout="this.className='';">{L_COLOR_GREY}</button><br />
Remove the red maked line with the next code. You will need to delete that part of the code If you want to add another color and write it like the next code. ALWAYS!

Now, this is the new one that will work: (Write anything you like on it. It will be the name of the color).
<button style="color:grey;" onclick="bbfontstyle('', '');selectWysiwyg(this, 'color');return false;" onmouseover="this.className='selectHover';" onmouseout="this.className='';">Grey</button><br />
But, there is another thing you need to know. The color names will not always work with the HTML Code, so you will need to find another sources to get help about color codes. For example: If you want to add a color name Light Purple the name will be not recognize by the user browser, so it is more safe to use Color Codes.

For example:
#FF0080 = Light Purple
#804000 = Brown

You will need to write only the color (HEX) code into this line:
<button style="color:#804000" onclick="bbfontstyle...
and write the color name into this line:
..."this.className='';">Brown</button><br />
Here, it is a good color codes resource for begin:
Code:
http://www.computerhope.com/htmcolor.htm
I hope you understand me, this is my first HTML tutorial that I am giving and I hope not the last one. Any question just reply or send me a PM and sorry for my bad English.

Good Luck!

BEST REGARDS
GUNHACK X
Gunhack X
Gunhack X
Forumember

Male Posts : 479
Reputation : 14
Language : English, Español
Location : USA

http://windows.topgoo.net

Back to top Go down

How to add font and font color in posting body (messages)? Empty Re: How to add font and font color in posting body (messages)?

Post by Claudia November 26th 2008, 9:35 pm

Thank Gunhack for your answers but I tried this already and it's not working Crying or Very sad

The font worked fine but when I added a color it disappeared and now I can't get it to work again.

Hopefully someone knows how to solve this...
avatar
Claudia
Forumember

Posts : 37
Reputation : 0
Language : Dutch
Location : The Netherlands

Back to top Go down

How to add font and font color in posting body (messages)? Empty Re: How to add font and font color in posting body (messages)?

Post by Gunhack X November 27th 2008, 1:56 am

But, I test it.

Did you remove the {L_COLOR_GREY}? from the code and replace it by the name of the color? because it was your problem.
Gunhack X
Gunhack X
Forumember

Male Posts : 479
Reputation : 14
Language : English, Español
Location : USA

http://windows.topgoo.net

Back to top Go down

How to add font and font color in posting body (messages)? Empty Re: How to add font and font color in posting body (messages)?

Post by Claudia November 28th 2008, 3:19 pm

Yes, I did that.
avatar
Claudia
Forumember

Posts : 37
Reputation : 0
Language : Dutch
Location : The Netherlands

Back to top Go down

How to add font and font color in posting body (messages)? Empty Re: How to add font and font color in posting body (messages)?

Post by Doomie November 28th 2008, 3:45 pm

Maybe something like this...
Code:

<button style="color:blue !important; # <-- Font color
   " onclick="bbfontstyle('', '') !important;
   selectWysiwyg(this, 'color') !important;
   return false !important;
   " onmouseover="this.className='selectHover' !important;
   " onmouseout="this.className='' !important;
   ">text goes here!</button><br />


The result should be like this...
<html>
<head>
<button style="color:blue !important; # <-- Font color
" onclick="bbfontstyle('', '') !important;
selectWysiwyg(this, 'color') !important;
return false !important;
" onmouseover="this.className='selectHover' !important;
" onmouseout="this.className='' !important;
">text goes here</button><br />
</body>
</html>

Atleast it works here on the forums & my forum ^^

I hope i helped!
Regards,

Doomie
Doomie
Doomie
Forumember

Male Posts : 140
Reputation : 0
Language : English,Swedish,Arabic
Location : Gothenburg, Sweden

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum