Trying to give a span with a background a border radius poses a challenge when word-wrap is involved. The desired outcome is rounded edges, except for the top left edge, but achieving this with the border-radius property seems tricky.
If anyone has an innovative idea on how to accomplish this, please share! Thank you.
edit: Here are the codes I've been working with:
.messageTextCont {
margin-left: 5px;
word-break: break-word;
}
.messageText {
font-size: 17px;
font-weight: 300;
color: #FBFDFE;
background-color: #402060;
padding: 0px;
box-shadow: 5px 0 0 #402060, -5px 0 0 #402060;
line-height: 23px;
-moz-border-bottom-left-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
border-bottom-left-radius: 5px;
-moz-border-bottom-right-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
border-bottom-right-radius: 5px;
-moz-border-top-right-radius: 5px;
-webkit-border-top-right-radius: 5px;
border-top-right-radius: 5px;
}
edit2: Open to solutions involving JavaScript as well
edit3: A step closer to the desired design by using the following styling:
-webkit-box-decoration-break: clone;
-o-box-decoration-break: clone;
box-decoration-break: clone;
However, this method applies rounded corners where not intended. Despite partially resolving the issue by overlapping lines slightly, now facing letter overlap. Would appreciate any suggestions to tackle this problem directly without compromising the design.
edit4: Employed box shadows to mask unwanted gaps in the layout:
box-shadow: 5px 0 0 #402060, -5px 0 0 #402061, -5px -3px 0 orange, 5px -3px red;
The current result showcases progress; however, the lower line still overlaps the upper one. If there's a technique to reverse this overlap while maintaining the aesthetic, all input is welcome.