Attention:

Support Rules and Guidelines
Before you post your support topic, please remember to:
  • Read the support forum rules.
  • Check the wiki and use search to see if your problem can be answered there first.
  • Link your board please, and make sure that the problem on your board is visible to guests or provide a test account.
  • Do not post Board Wrappers and CSS unless requested. With a board link, this is not necessary.
  • Be as descriptive as you can and use as many details as possible when describing your problem.
  • Please briefly mark any links to forums that may not be work-safe.
This will help ensure your support issue will be attended to in a quick and efficient manner.

  Add ReplyNew TopicNew Poll

 CSS & Group IDs
#
Hey folks! Another coding question here.

I am attempting to do a code in which certain colors on the Mini Profile change to match a group's select hue. Essentially, I was going to try something like:
CODE
<div  class="<!-- |g_id| -->"><span id="name">Stuff</span></div>


Now the question is, in my CSS.. How would I format the class to match the ID? Would it be
CODE
.g-1 { }


Or

CODE
.1 { }



... I hope that makes sense? Haha. Thanks for the help!
PM
#
Currently, it would be .1

signature
user posted image
#
Hmm, I've tried this and it appears to not be doing anything. Admin/Staff group appears to be 4 by standard, so I tried
CODE
.4 { color: #a34071!important; }


However it's not registering this hue change anywhere that I have
CODE
<div class="<!-- |g_id| -->">Info</div>


I also attempted forcing the class div to "4" in the Mini Profile code, and it did not register the hue change then, so I'm thinking there's a hiccup somewhere there.
PM
#
QUOTE (Ekko @ Nov 14 2016, 04:56 PM)
Hmm, I've tried this and it appears to not be doing anything. Admin/Staff group appears to be 4 by standard, so I tried
CODE
.4 { color: #a34071!important; }


However it's not registering this hue change anywhere that I have
CODE
<div class="<!-- |g_id| -->">Info</div>


I also attempted forcing the class div to "4" in the Mini Profile code, and it did not register the hue change then, so I'm thinking there's a hiccup somewhere there.


Try changing it to g-<!-- |g_id| --> and the CSS class changes to .g-4

signature
user posted image
#
Hah! This worked, I hadn't even considered that. Thank you so much!
PM
#
    As a note, you can't use just numbers for CSS class indicators. It's not compatible and screwy.
PM
#
QUOTE (multiplicity! @ Nov 14 2016, 06:17 PM)
    As a note, you can't use just numbers for CSS class indicators. It's not compatible and screwy.



Not just that but a CSS class or ID cannot start with a number either. A lot of programming languages have this restriction too. var 1test =''; would be an error in javascript. $1test would also be an error in PHP and most other languages.

signature
email: admin@jcink.com :: blog: John C.
#
That was where my issue was - I had looked it up and got incorrect information that IDs couldn't start with numbers but CLASSES could. Turns out, this was wrong, and I was unaware, lol!

Thank you all for the help and the information!
PM
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Share this topic:
« Next Oldest | General Support | Next Newest »

Options Add ReplyNew TopicNew Poll