Storm
New Member
Posts: 28
inherit
243407
0
Aug 5, 2018 3:07:44 GMT -8
Storm
28
April 2017
thestorm
|
Post by Storm on Jul 30, 2018 3:30:15 GMT -8
awarriorstory.proboards.com/Hello! I want to hover over an image, have it go opaque, and then have text appear in the middle of the image. This is for the staff section in my banner. I am bad at coding and can't seem to figure it out. Thank you very much!
|
|
inherit
242907
0
Dec 17, 2021 17:23:41 GMT -8
Sammiie
155
March 2017
sammiie
|
Post by Sammiie on Jul 30, 2018 3:44:11 GMT -8
You want like an overlay? Look at this site, click the "try it yourself" link and copy the code they have there exactly. Try not to change the class names if you don't have to (they're pretty confusing if you don't know what you're doing). You can change the color hexes and width / size of the images to better fit your needs, but don't mess with the transitions too much! If you need more specific help, tag me!
|
|
Storm
New Member
Posts: 28
inherit
243407
0
Aug 5, 2018 3:07:44 GMT -8
Storm
28
April 2017
thestorm
|
Post by Storm on Jul 30, 2018 3:55:16 GMT -8
The link isn't working for me
|
|
inherit
242907
0
Dec 17, 2021 17:23:41 GMT -8
Sammiie
155
March 2017
sammiie
|
Post by Sammiie on Jul 30, 2018 5:02:44 GMT -8
|
|
Storm
New Member
Posts: 28
inherit
243407
0
Aug 5, 2018 3:07:44 GMT -8
Storm
28
April 2017
thestorm
|
Post by Storm on Jul 30, 2018 6:02:38 GMT -8
|
|
inherit
242907
0
Dec 17, 2021 17:23:41 GMT -8
Sammiie
155
March 2017
sammiie
|
Post by Sammiie on Jul 30, 2018 7:04:59 GMT -8
You'd copy the CSS part (the one between the <style></style> tags) into your layout's Stylesheet (found in Admin > Themes > Advanced Styles & CSS). Scroll all the way to the bottom and paste this in: .container { position: relative; width: 50px; }
.image { display: block; width: 50px; height: auto; }
.overlay { position: absolute; bottom: 0; left: 0; right: 0; background-color: #008CBA; /* CHANGE THIS TO THE HEX CODE / COLOR YOU WANT */ overflow: hidden; width: 50px; height: 0; transition: .5s ease; }
.container:hover .overlay { height: 100%; }
.text { color: white; font-size: 10px; position: absolute; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); -ms-transform: translate(-50%, -50%); transform: translate(-50%, -50%); text-align: center; } Once you've got that pasted & saved, go to your Layout Templates (Admin > Themes > Layout Templates > Forum Wrapper) and look / find (CTRL + F) for this: <div style="padding:1px;"><img src="https://i.imgur.com/6mex7kY.png"> </div> You'd replace that part with this: <div class="container"> <img src="https://i.imgur.com/6mex7kY.png" alt="Avatar" class="image"> <div class="overlay"> <div class="text">Name</div> </div> </div> </div> Save. And you should be good! Any other staff you get, you can just double or triple the third coding snippet (the HTML) to copy over the overlay to anyone else's image. All you'd need to do is change the image! Storm
|
|
Storm
New Member
Posts: 28
inherit
243407
0
Aug 5, 2018 3:07:44 GMT -8
Storm
28
April 2017
thestorm
|
Post by Storm on Jul 31, 2018 2:43:14 GMT -8
Thank you so much Sammiie . That worked!
|
|
Storm
New Member
Posts: 28
inherit
243407
0
Aug 5, 2018 3:07:44 GMT -8
Storm
28
April 2017
thestorm
|
Post by Storm on Jul 31, 2018 2:56:26 GMT -8
I take that back. Something weird happens whenever I add the CSS. The forum gets super skinny
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,780
January 2015
msg
|
Post by Lynx on Jul 31, 2018 6:15:46 GMT -8
Most likely because of this part: .container { position: relative; width: 50px; }
.container is a class used by PB and that code snippet is setting the container width to 50px.
|
|
Storm
New Member
Posts: 28
inherit
243407
0
Aug 5, 2018 3:07:44 GMT -8
Storm
28
April 2017
thestorm
|
Post by Storm on Jul 31, 2018 6:34:26 GMT -8
That would make sense. How can I fix it?
|
|
Storm
New Member
Posts: 28
inherit
243407
0
Aug 5, 2018 3:07:44 GMT -8
Storm
28
April 2017
thestorm
|
Post by Storm on Jul 31, 2018 6:42:28 GMT -8
Wait, nevermind! I figured it out and everything seems to be working! Thanks for everyone's help
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,780
January 2015
msg
|
Post by Lynx on Jul 31, 2018 6:42:48 GMT -8
Try changing that .container to a class name not used. For example, as long as the class .mycontainer doesn't already exist on your forum, you could try changing every aspect of .container to .mycontainer so the result would look like this: CSS: HTML: I've highlighted the changes in red. See if that works for you.
|
|
Storm
New Member
Posts: 28
inherit
243407
0
Aug 5, 2018 3:07:44 GMT -8
Storm
28
April 2017
thestorm
|
Post by Storm on Jul 31, 2018 7:07:59 GMT -8
Yep, that's what I did! Everything worked out! Thank you so much
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,780
January 2015
msg
|
Post by Lynx on Jul 31, 2018 7:09:50 GMT -8
Glad you got it sorted!
|
|