Skip to content
View in the app

A better way to browse. Learn more.

The Daily Neopets Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Coding Help: Changing Text Colors

Featured Replies

I realize this should be pretty easy but I can't seem to make it work so appreciate any help.

 

I'm trying to change the colors of 3 texts in my pet's lookup, specifically the:

 

1. Pet's color, in this case, the word "Faerie"

2. Hitpoints color which is defaulted to green

3. "Challenge" text

 

I want them all to be a uniform color.

 

This is the current lookup: http://www.neopets.com/petlookup.phtml?pet=Lucien725

 

I've tried these from: http://www.neopets.com/~darkest_faerie_lair

But they don't seem to work. Or I just don't know how.

<style>.contentModuleContent, .contentModule {	background: #0F0;	color: #00F;}</style>

<style>div div div div b {	color: #FFF;}</style>

<style>.content div {	color: #F00;}.content div div {	color: none;}</style>

This topic has been edited by a member of staff (Ruto).

The topic was posted in the wrong area.

Please check your user inbox to see if you have been contacted regarding this topic.

Per the reason above, this topic has been MOVED from Graphics to Computers & Programming.

 

Edit: Oops, sorry for posting in the wrong area.

 

 

After some more research (and frustration, lol), I finally have a working code. I added this:

font, td, div, p, span, b, a, a b, h2 {	color: #73b5eb !important;}

So for anyone who has the same problem, this worked for me.

 

Does anyone know what this line is for?

!important

This post has been edited by a member of staff (Ruto) because of a violation of the forum rules.

Please do not double post. Use the edit button if you have something to add.

Please check your user inbox to see if you have been contacted regarding this incident, then review our rules.

To be honest, I have never bothered to look into neopets lookups coding. But! Link coding in CSS always ends with a. So, it should be

<style>
.content div a {
	color: #F00;
}
.content div div a {
	color: none;
}
</style>

And just add the a to the end of the rest of the stuff, too. See if that works?

Does anyone know what this line is for?

!important

 

!important means that if you try to set the same attribute to a different value later in your <style>, it will not be overwritten as it normally would be.

A good resource for everything coding related is w3schools.

 

Now to address your coding, I'm not sure if it's just the way you posted it or if that's the way you have them in your code.

When you have CSS codes that go between style tags, you only need one set of style tags. Everything CSS goes in there.

 

For the !important it overrides any previous code or conflicting code within the page. Sometimes in order to override something TNT has placed on lookups, this code is needed. I have it in a few spots on my lookup.

 

My guess as to what went wrong was you weren't using proper hex codes for your color and as soon as you did that it decided to work. You shouldn't actually need the !important there.

  • Author

Actually, I think I finally selected the right element (?) that made it work. I'm referring to the below:

font, td, div, p, span, b, a, a b, h2

I'm still not exactly sure which element it was but it's one of those. Lol.

 

@Dawn, I kind of worked it out that links ended in 'a' and images ended in 'img'. h1 and h2 are headers. But I have no idea what 'b' or 'span' are.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.