How to underline words with .-.-.-.-. pattern using HTML and CSS, or MS Word?
I know there are border-bottom-style properties in CSS, there are dotted and dashed styles, but there is no dot-dashed or something like that. In MS Word also there are different underline styles but not the one I need.
you may, from an inline element, use simple border-bottom or play with gradient and multiple bg or even border-image.
I like the gradient better wich allow you to do almost any pattern. (make a search on bg pattern from gradient, you will be surprised)
.dotted.underline {
border-bottom: dotted 1px;
}
.bg {
background: linear-gradient(to left, green 50%, transparent 50%) 0 bottom repeat-x, linear-gradient(to left, transparent 60%, red 60%, red 90%, transparent 90%) 14px 1.1em repeat-x;
background-size: 14px 2px, 14px 2px;
padding-bottom: 2px
}
p {
float: left;
width: 45%;
}
<p><span class="dotted underline">Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</span></p>
<p><span class="bg">Pellentesque habitant, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</span></p>