MyBB Community Forums

Full Version: Fa icons next to some link/text
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

so i managed to create a neat drop down list. But when i tried adding font awesome icons next to it, it kinda didn't work.
Could some explain me how i would get the fa icons next to the links on the drop down list? Maybe also with the codes i added below.

I tried adding e.g. <i class="fa fa-comments"> right before the usercp or before the "Settings", but it doesn't get at the same line.

The required part in headerinclude is included:
<link href='//' rel='stylesheet' type='text/css'>

[Image: 691a37fc0f857f4d0272d9c2e3268dd0.gif](As you can see the icon is at the top left)

How i made the drop down:

<div class="dropdown">
  <button onclick="myFunction()" class="dropbtn">Settings</button>
<div id="myDropdown" class="dropdown-content">
  	<i class="fa fa-comments"></i><a href="{$mybb->settings['bburl']}/usercp.php" class="usercp" >Control Panel</a>
	<a href="#" onclick="MyBB.popupWindow('{$mybb->settings['bburl']}/misc.php?action=buddypopup&modal=1', null, true); return false;">{$lang->welcome_open_buddy_list}</a>
    <a href="{$mybb->settings['bburl']}/search.php?action=getnew">{$lang->welcome_newposts}</a>
    <a href="{$mybb->settings['bburl']}/search.php?action=getdaily">{$lang->welcome_todaysposts}</a>
    <a href="{$mybb->settings['bburl']}/private.php">{$lang->welcome_pms}</a> {$lang->welcome_pms_usage}

.dropbtn {
	-moz-box-shadow:inset 47px 50px 0px 15px #F5F5F5;
	-webkit-box-shadow:inset 47px 50px 0px 15px #F5F5F5;
	box-shadow:inset 47px 50px 0px 15px #F5F5F5;
	border:1px solid #F9DD54;
	padding:2px 20px;
	margin: -3px 10px 0 0;

.dropdown {
    position: relative;
    display: inline-block;

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    overflow: auto;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;

.dropdown a:hover {background-color: #F9DD54}

.show {display:block;}

/* When the user clicks on the button,
toggle between hiding and showing the dropdown content */
function myFunction() {

// Close the dropdown if the user clicks outside of it
window.onclick = function(event) {
  if (!'.dropbtn')) {

    var dropdowns = document.getElementsByClassName("dropdown-content");
    var i;
    for (i = 0; i < dropdowns.length; i++) {
      var openDropdown = dropdowns[i];
      if (openDropdown.classList.contains('show')) {
Thanks for any help.
The format can be like this;

<a href="{$mybb->settings['bburl']}/usercp.php" class="usercp" ><i class="fa fa-comments" aria-hidden="true"></i>&nbsp;Control Panel</a>

class="usercp" and the other classes on the nav links are no longer needed.
Thank you very much!