View Single Post
Old 08-02-2019, 05:42 PM   #15
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
If you don't actually want a specific width, just a border that is the same width as the text, with these additions in red it worked in ADE 1.7.2, Kobo RMSDK10, and Calibre 2.85:

(Edit: I've added a break in the paragraph to show the difference between this and Sunlite's solution, which is what happens when the paragraph has more than one line: this solution has a border under the whole paragraph, Sunline's has a border under each line.)

Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link href="../Styles/Style0001.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<div class="center">
<p class="test">Test test<br/>test</p>
</div>
</body>
</html>
Code:
div.center {
  text-align: center;
}
p.test {
  display: inline-block;
  text-align: center;
  border-bottom: 1px solid black;
  /*width:10em;*/
}

Last edited by GeoffR; 08-02-2019 at 05:54 PM.
GeoffR is offline   Reply With Quote