Css how to wrap text in li

Viewed 35926

I'm trying to wrap my text in my slide menu. I have ul max-width 200px, but when I write longer text, then my text is not visible ( now i added overflow: visible to show You what I mean ). How to wrap this?

enter image description here

My code looks like this:

<nav class="navbar navbar-default" role="navigation">

<div class="dropdown">
    <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown">
        Dropdown
        <span class="caret"></span>
    </button>
    <ul class="dropdown-menu" style="max-width: 200px" role="menu" aria-labelledby="dropdownMenu1">
        <li role="presentation" class="dropdown-header">Dropdown header</li>
        <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Action</a></li>
        <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Another action</a></li>
        <li role="presentation" class="disabled"><a role="menuitem" tabindex="-1" href="#">Something else here</a></li>
        <li role="presentation" class="divider"></li>
        <li role="presentation" class="dropdown-header">Dropdown header</li>
        <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Separated link</a></li>
    </ul>
</div>

</nav>

And css now :

<style>

    .dropdown .dropdown-menu {
        -webkit-transition: all 0.3s;
        -moz-transition: all 0.3s;
        -ms-transition: all 0.3s;
        -o-transition: all 0.3s;
        transition: all 0.3s;

        max-height: 0;
        display: block;
        overflow: hidden; <-- here i was trying to add  word-wrap: break-word; but it doesn'twork   
        opacity: 0;
    }

    .dropdown.open .dropdown-menu {
        max-height: 200px;
        opacity: 1;
    }
</style>
3 Answers
Related