I'm wanting to implement a multiline selection section in html that looks like:
But with <span> tags and css, the closest I've been able to come up with is:
.textblock {
width:200px;
/* I don't want justified text, but this straightens the ratty edge */
text-align: justify;
}
.highlighted {
border-radius: 10px 0 10px 0;
background-color: rgb(61, 107, 39);
border: 1px solid rgb(61, 107, 39); /* bit of a cheat*/
/* the following almost works */
/* box-shadow: 10px 10px 10px black; */
}
This isn't so great because:
- the corners aren't all rounded
- I didn't really want justified text (hack to make right edge line up)
- Enabling box shadow results in disaster
Any tips on how to make this better?
Right now I'm wondering if I may have to craft the shape I want in javascript and draw it on a lower layer. Maybe I could use something like offsetLeft and friends to get the span's dimensions...?
Of course, if there's a simpler way in css, I'd love to do that instead!