Below is a small html page that looks different in Chrome vs Firefox browsers.
Could anybody please explain why it looks different in Chrome if create an html document locally and open this document via Chrome (jsfiddle shows it normally in Chrome, that's why I didn't create jsfiddle page as well)?
<!DOCTYPE html>
<html>
<head>
<title>CCCC</title>
<style>
body * {
text-rendering:optimizeLegibility;
}
body,html {
font-family:Arial,Helvetica,sans-serif;
}
#lesu-tab ul li {
list-style:none;
font-size:14px;
font-weight:700;
float:left;
}
#lesu-tab ul li a {
border:1px solid #888;
display:block;
}
.buggy{
font-size:12px;
}
</style>
</head>
<body>
<div id="lesu-tab">
<ul>
<li><a href="http://www.example.com/">Link1</a></li>
<li><a href="http://www.example.com/">Link2</a></li>
<li><a class="buggy" href="https://www.example.com/">A ABC DEFGHIJ</a></li>
</ul>
</div>
</body>
</html>
What makes me even more surprised is that if you change the font size from 12px to 11px or 13px for class="buggy"
, Chrome displays it not in two lines, but in one - normally.
Also, if you remove one or another one of any css properties on the page, it is displayed in one line as well. That's unclear for me why is this happening? Is this a bug?
Any ideas how to fix it without removing css properties?
And of course the code above is just less than 1% of a huge html page that causes this issue.
Thank you.