When using "text-align" on a block element that is first child of a list item, the list marker is aligned according to "text-align" from the child.
Example: The input
will produce a list with both list marker ("1.") and the content ("right") aligned to the right.
Expected result: List markers should be left aligned even when first child uses "text-align" to align content.
Best regards,
Mikkel
I'm having problems uploading attachments so here is an example html document showing the bug
Example: The input
<ol>
<li><div style="text-align: right">right</div></li>
</ol>
will produce a list with both list marker ("1.") and the content ("right") aligned to the right.
Expected result: List markers should be left aligned even when first child uses "text-align" to align content.
Best regards,
Mikkel
I'm having problems uploading attachments so here is an example html document showing the bug
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title>bug-text-align-inside-lists</title>
</head>
<body>
<h1><code>text-align</code> inside lists</h1>
<p>
Apparently, the list item uses <code>text-align</code> from
first child. This is inconsistent with browser rendering.
</p>
<ol>
<li>
<div>left</div>
</li>
</ol>
<ol>
<li>
<div style="text-align: left">left</div>
</li>
<li>
<div style="text-align: center">center</div>
</li>
<li>
<div style="text-align: right">right</div>
</li>
</ol>
<ul>
<li>
<div style="text-align: left">left</div>
</li>
<li>
<div style="text-align: center">center</div>
</li>
<li>
<div style="text-align: right">right</div>
</li>
</ul>
<p>
If content is added before element with <code>text-align</code> it works as expected.
</p>
<!-- this works -->
<ol>
<li>
<div></div>
<div style="text-align: left">left</div>
</li>
<li>
<div></div>
<div style="text-align: center">center</div>
</li>
<li>
<div></div>
<div style="text-align: right">right</div>
</li>
</ol>
<ul>
<li>
<div></div>
<div style="text-align: left">left</div>
</li>
<li>
<div></div>
<div style="text-align: center">center</div>
</li>
<li>
<div></div>
<div style="text-align: right">right</div>
</li>
</ul>
<!-- this works -->
<ol>
<li>
<span> </span>
<div style="text-align: left">left</div>
</li>
<li>
<span> </span>
<div style="text-align: center">center</div>
</li>
<li>
<span> </span>
<div style="text-align: right">right</div>
</li>
</ol>
<ul>
<li>
<span> </span>
<div style="text-align: left">left</div>
</li>
<li>
<span> </span>
<div style="text-align: center">center</div>
</li>
<li>
<span> </span>
<div style="text-align: right">right</div>
</li>
</ul>
</body>
</html>