I'm testing some html and css stuff, and i have a problem.
I have some divs floating next to each other with width:15%;
, and when i type long words, they overlap.
I found a solution by using word-wrap:break-word
.
but: i think it's kind of weird to split a word without a dash (-) character.
so, right now, my div looks like this:
<style>
.floating-div{
margin: 1px;
float: left;
padding: 1%;
word-wrap: break-word;
}
</style>
<div class="floating-div">
<p>Hexakosioihexekontahexaphobia</p> <!--Just a random long word-->
</div>
|---------------|
|hexakosioihexe |
|kontahexaphobia|
| |
|---------------|
can i somehow make it automatically add a dash like this? (by using css or javascript)
|----------------|
|hexakosioihexe- |
|kontahexaphobia |
| |
|----------------|