So far this is the workaround that I am using. Not working as I want to as you may see if you run the code.
b {
font-weight:normal;
border-left: 2px solid blue;
padding: 2;
position: absolute;
left: 0%;
}
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<span id="content" style="line-height: 1.8">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent sit amet odio eu magna mattis vehicula. Duis egestas fermentum leo. Nunc eget dapibus eros, id egestas magna. Fusce non arcu non quam laoreet porttitor non non dui. Ut elit nisl, facilisis id hendrerit et, maximus at nunc. Fusce at consequat massa.
</span>
<br/><br/>
<button id="vertical_line">Vertical Line</button>
<script>
document.getElementById("vertical_line").onclick = function() {
// Get Selection
sel = window.getSelection();
if (sel.rangeCount && sel.getRangeAt) {
range = sel.getRangeAt(0);
}
// Set design mode to on
document.designMode = "on";
if (range) {
sel.removeAllRanges();
sel.addRange(range);
}
// Colorize text
document.execCommand("bold", false,);
// Set design mode to off
document.designMode = "off";
}
</script>
</body>
</html>
Once I select a text and then click the button, the selected text will be surrounded by the tags "< b >". What I did is edit the style of "bold" in CSS. It's quite an ugly work-around so far. I would be grateful if anybody can come up with a smarter solution.
There is a vertical line appearing, but still not along the side as I want it to do.
Cheers