- This topic is empty.
-
AuthorPosts
-
January 13, 2014 at 5:58 am #160244
mintertweed
ParticipantHere is the website in question. I would like each project page to have a different color for the scrollbar. I thought this would be a simple thing to do, but I must be doing something wrong. For webkit browsers, I have this CSS for the scrollbar:
::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); background-color: #EBEBEB; } ::-webkit-scrollbar { width: 10px; background-color: #EBEBEB; } ::-webkit-scrollbar-thumb { background-color: #FF0066; }
Fairly simple and to the point. Welp, to make it different for each of the project pages, I have a function in
functions.php
that gives each page its own class. So, for the page about “Digital Simulacra” it’s.page-digital-simulacra
. So, one would assume I could put this….page-digital-simulacra ::-webkit-scrollbar-thumb { background-color: #B5B5B5; }
…in there and it should change the scrollbar from a vibrant pink to a mild gray, but it’s not. What am I not doing correctly? Thank you in advance!
January 13, 2014 at 6:05 am #160245Paulie_D
MemberDoes it work without the space?
.page-digital-simulacra::-webkit-scrollbar-thumb { background-color: #B5B5B5; }
January 13, 2014 at 6:09 am #160246Paulie_D
MemberOf course the
::
usually means the root so I’m not entirely sure you can achieve what you are after.You might actually have to attach the class to the
HTML
element and not the body.January 13, 2014 at 6:49 am #160250mintertweed
ParticipantHow would I code that?
Edit #1: And which one needs to be attached to the
HTML
element?Edit #2: If you couldn’t tell, I know very little about this manner. I generated the scrollbar code through a coding website made specifically for that.
Edit #3: And no, to answer your question, it doesn’t work even if I remove the space.
Edit #4: And the code your directing me to is JavaScript to move the page down on page load. I don’t quite understand why it would be attached to that.
January 13, 2014 at 7:46 am #160257Paulie_D
MemberI’m not “directing” you to any code. The image demonstrates (I think) that the
::
tag is ‘linked’ to thehtml
element (as that is what I have selected) and not thebody
or any classed version.Is it even possible to add a class to the
html
element?January 13, 2014 at 8:05 am #160260mintertweed
ParticipantYes, you can. It looks like by using Modernizr for WordPress, I might be able to apply a different class to the
HTML
element for different pages. I’ll have to look further into it.Edit: Now, I just need to figure out how to add a different class for each page to the
HTML
element. Hrm. -
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.