Solution 1 :

Just add the pointer-events: none css property to the i tag element:

.fa {
  pointer-events: none;

to prevent any pointer events for the <i> tag

Live Demo: CodePen

Problem :

I added a dropdown button with a down arrow (image) with the help of However, after adding the down arrow image, the image area of the button cannot be clicked? Not quite sure what went wrong here, the button is still functional.



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

    <!-- dropdown feature -->
    <div class="dropdown">
        <button onclick="dropdownMenu()" class="dropbtn">User

            <!--image cant be clicked???-->
            <img src="images.png" style="height:8px; width:10px; margin-bottom: 2px; margin-left: 5px;">


        <!-- dropdown content -->
        <div id="myDropdown" class="dropdown-content">
            <a href="profile.html">Profile</a>
            <a href="settings.html">Settings</a>
            <a href="#">Logout</a>



.dropbtn {
    background-color: white;
    color: black;
    padding: 10px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    position: absolute;
    top: -69.5px;
    left: 1280px;
    border-radius: 4px;
    width: 90px;

.dropbtn:hover, .dropbtn:focus {
    background-color: rgb(218, 218, 218);

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

.dropdown-content {
    display: none;
    position: absolute;
    top: -20px;
    left: 1210px;
    background-color: #f1f1f1;
    min-width: 164px;
    overflow: auto;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 6px;

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

.dropdown a:hover {background-color: #ddd;}

.show {display: block;}

Can someone please help identify what is the error here? Thanks a lot!


Comment posted by

Everything looks right to me.. I even tested it and it works just fine for me..