Reputation: 6779
I have a dropdown in BS4 navbar. The content goes out of the container on mobile device. I want to wrap the text through css.
Following code works:
HTML:
<div class="dropdown-menu" >
{% for department in object.departments.all %}
<a class="dropdown-item text-wrap" href="">
{{ department.name }}</a>
{% endfor %}
</div>
CSS:
.dropdown-menu {
width: 30vw;
}
But following code doesnt work:
HTML:
<div class="dropdown-menu" >
{% for department in object.departments.all %}
<a class="dropdown-item" href="">
{{ department.name }}</a>
{% endfor %}
</div>
CSS:
.dropdown-menu {
width: 30vw;
}
.dropdown-item{
text-wrap:normal;
}
Upvotes: 0
Views: 102
Reputation: 3966
I think you are looking to use the white-space
property or possibly to use word-wrap
or text-overflow
.
I've not heard of the text-wrap
property in css.
Upvotes: 1