MyBB Community Forums

Full Version: New thread css button, text color doesn't change
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

i was trying to change the style of the new thread button, but for some reason the text color of the button doesn't change (should be white), while the background does and while the text color does change on mouse hover. I am quite confused why this would happen, would appreciate some help.

Css:
.button2 {
  -webkit-border-radius: 3;
  -moz-border-radius: 3;
  border-radius: 3px;
  font-family: Arial;
  color: #ffffff;
  font-size: 19px;
  background: #e04141;
  padding: 5px 18px 5px 18px;
  border: solid #969696 1px;
  text-decoration: none;
}

.button2:hover {
  -webkit-border-radius: 3;
  -moz-border-radius: 3;
  border-radius: 3px;
  color: #ffffff;
  background: #f5db34;
  font-size: 19px;
  text-decoration: none;
}
Forum display new thread looks like this:
<a href="newthread.php?fid={$fid}" class="button2"><span>{$lang->post_thread}</span></a>
Demo of the issue:
[Image: e04a07ed3f746247e73bb2e3626623d4.gif]
Why #button2 and not .button2 ?
I edited the thread right after posting, it should be .button2 yes, but the issue is still there.
(2016-09-07, 02:21 AM)thelovelyone Wrote: [ -> ]I edited the thread right after posting, it should be .button2 yes, but the issue is still there.

<span class="button2">{$lang->post_thread}</span>

Alternatively you need to define your CSS something like this:

.button2 a:link {
color: #fff;
}
It still doesn't work.

<span class="button2"><a href="newthread.php?fid={$fid}">{$lang->post_thread}</a></span>
Did like this^^

And i also added that to css:

.button2 a:link {
color: #fff;
}


However its still not white.
(2016-09-07, 02:37 PM)thelovelyone Wrote: [ -> ]It still doesn't work.

<span class="button2"><a href="newthread.php?fid={$fid}">{$lang->post_thread}</a></span>
Did like this^^

And i also added that to css:

.button2 a:link {
color: #fff;
}


However its still not white.

It will be white if you put it

<a href="newthread.php?fid={$fid}"><span class="button2">{$lang->post_thread}</span></a>

Or

<a class="button2" href="newthread.php?fid={$fid}">{$lang->post_thread}</a>

with

.button2 a:link {
color: #fff;
}
Thanks that worked.
Appreciate your help! Wink
This is the correct code and it works well!

Home » Template Sets » Templates » Edit Template: showthread_newreply

<a href="newreply.php?tid={$tid}"class="button2"><span>{$lang->new_reply}</span></a>&nbsp;


Home » Template Sets » Templates » Edit Template: forumdisplay_newthread

<a href="newthread.php?fid={$fid}" class="button2"><span>{$lang->post_thread}</span></a>


If you have any questions, just feel free to contact me!