How would I add color to the text here? I'm stuck on this

It tells me that you shouldn’t rely on that as a source of information, because the advice given there is decades out of date. <font> tags have been deprecated since the introduction of HTML4.01. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/font

It doesn’t answer the question of what you’re trying to achieve, or why.

3 Likes

If you are trying to style the word “text”, then you would need to apply the style attribute to the <td> which is the container for that text, not to a hidden input.

It tells me you need to learn html instead of copying snippets of code you find on-line, without having any understanding of what it is or how it works.
Until you do, progress will be very slow and very tedious and people will lose patience with you.

4 Likes

This would be ok then?

<table>
<tr><td style="color:red;"><input type="hidden" name="on0" value="text">text</td></tr><tr><td><select name="os0">
 <option value="Blue">Blue</option>
 <option value="</option>
 <option value="</option>
 <option value="</option>
</select> </td></tr>
</table>

Does it work? Does it do what you want?

yess

OK - then that’s answered your question.

I’m not going to say it’s OK, because other parts of your code are invalid, but you’ve changed the colour of the text, which is what you wanted.

other parts of your code are invalid

???

Specifically this part:

<option value="Blue">Blue</option>
<option value="</option>
<option value="</option>
<option value="</option>

(If you get into the habit of running your code through the HTML validator, https://validator.w3.org/, you’ll be able to spot these problems for yourself. It’s what any decent coder does.)

1 Like

I only put the part of the code I needed help with.

That’s up to you. Just remember to fix that in your “real” code.

For future reference, posting incomplete code is always a bad idea. You may think the issue lies in one section, but an error in another section can have a knock-on effect. Always check the code for errors as the first step in any trouble-shooting.

Question, should I use div style instead?

A <div> is an HTML element, so it has no style as such.

If you mean “should I follow this tutorial which includes the use of divs in the form?”, then the answer is “it depends”.

What do you want to achieve? Does this tutorial produce results you like better, or which are closer to the style you want?

What is it that makes you wonder whether that’s a better way to go?

I like this way better cause I’m only customizing how I want the text to look, not the whole entire thing.

Then why ask about doing something you don’t want or need?

As a general rule, keep your code as simple as possible. It’s easier to worrk with and easier to maintain.

So, I guess they do all you to customize it.

You’d need to check their TOS to see whether or not there are any restrictions on it. I don’t imagine they’d be happy if you tried to alter their logo, for example, but other customisations are probably fine.

I found this:
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/html_example_cart/

Where it says more text, can I give that a different color instead of red?

<table>
<tr><td style="color:red;"><input type="hidden" name="on0" value="text - more text">text - more text</td></tr><tr><td><select name="os0">
 <option value="Blue">Blue</option>
 <option value="</option>
 <option value="</option>
 <option value="</option>
</select> </td></tr>
</table>

Again, it would be very helpful to know exactly what your aim is here, because you seem to be confusing different parts of your code.

<td style="color:red;"><input type="hidden" name="on0" value="text - more text">text - more text</td>

Here, you have a <td>, which contains two items. The first is this:
<input type="hidden" name="on0" value="text - more text">
That’s a hidden input, which will not be displayed, as has already been explained above.

The second item within your <td> is your text: text - more text. If you set a colour on the <td>, it will affect all that text. If you want part of it a different colour, then you would need to wrap a <span></span> around that part, and apply the second colour there.