lkallas lkallas - 1 year ago 176
CSS Question

Styling language select button in html and css

I would like to style a language select button for my website. This is the design of what it should look like:

Language select button

I am using Bootstrap 3.

How can I achieve that? Any help is appreciated!


Solved it by creating a custom dropdown using css+jquery, see the result below.

Answer Source

There were many useless comments and downvotes. Useless comments should have downvote option as well.

At least giving some advice would have been helpful.

But anyway, got my problem sorted.

<!DOCTYPE html>
        <title>Custom dropdown</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        <!-- Font Awesome CSS -->
        <link rel="stylesheet" href="">        
        <!-- Latest compiled and minified Bootstrap CSS -->
        <link rel="stylesheet" href="">
        <!-- jQuery library -->
        <script src=""></script>
        <!-- Latest compiled Bootstrap JavaScript -->
        <script src=""></script>
        <!-- Google font -->
        <link href="|Rancho" rel="stylesheet">

        <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 9]>
          <script src=""></script>
          <script src=""></script>


            /* Custom dropdown */
            .custom-sel a {
                text-decoration: none;
                text-transform: uppercase;
                margin: 0;
                padding: 10px;
                text-align: left;
                font-family: Raleway;
                color: #546e7a;
                font-size: 15px;
                font-weight: 700;
                line-height: 24px;
                display: block;

            .custom-sel a:hover {
                text-decoration: none;
                background-color: #EDF0F2;
                color: #ffffff;

            .custom-sel a.selected {
                background-color: transparent;

            .custom-sel a.selected:hover {
                background-color: transparent;
                color: #546e7a;

            .hidden {
                display: none;

            .lightblue {
                margin-left: -4px;

            .show-sel {
                background-color: #ffffff;
                box-shadow: -5px 0px 65px 0px rgba(0, 0, 0, 0.18);

            .custom-sel {
                margin: 30px;
                display: inline-block;
            /* Custom dropdown */


        <script type="text/javascript">

            $(document).ready(function () {

                // Show dropdown
                $('.selected').click(function () {
                    $('.custom-sel a').removeClass('hidden');

                // Hide dropdown when not focused
                $('.custom-sel').focusout(function () {
                    $('.custom-sel a:not(:first)').addClass('hidden');
                }).blur(function () {
                    $('.custom-sel a:not(:first)').addClass('hidden');



        <div class="container">

            <!-- Custom dropdown -->
            <div class="custom-sel">
                <a class="selected" href="#">ENG &nbsp;<i class="fa fa-caret-down lightblue" aria-hidden="true"></i></a>
                <a class="hidden" href="#">EST</a>
                <a class="hidden" href="#">RUS</a>
                <a class="hidden" href="#">FIN</a>


Here's the result I'm currently happy with:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download