Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS issue with Chrome 61

I'm using a custom horizontal rule CSS style on my site. It looks like the following:

Styled HR in Firefox

But since I have updated my Google Chrome to version 61 the line height of the symbol is ignored and it looks like this:

HR in Chrome 61

I'm using the following code:

hr {
    background: #ccc;
    border: 0;
    height: 1px;
    line-height: 1 !important;
    margin: 20px 0;
    text-align: center;
    clear: both;
}
hr:after {
    content: '\f0c4';
    display: inline-block;
    position: relative;
    top: -10px;
    padding: 0 10px;
    background: #fff;
    color: #ccc;
    font-family: 'FontAwesome';
    font-size: 20px;
}
like image 213
jackennils Avatar asked Dec 08 '25 18:12

jackennils


1 Answers

The overflow property seems to have a new default value on the <hr> element.

It looks like the value changed from visible to hidden, so the icon is hidden. You can add overflow:visible to the <hr> element to show your icon again.

hr {
  background:#ccc;
  border:0;
  clear:both;
  height:1px;
  line-height:1 !important;
  margin:20px 0;
  overflow:visible;
  text-align:center;
}
hr:after {
  background:#fff;
  color:#ccc;
  content:'\f0c4';
  display:inline-block;
  font-family:'FontAwesome';
  font-size:20px;
  padding:0 10px;
  position:relative;
  top:-10px;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<hr/>

Hint: I recommend you to use normalize.css to avoid such an issue.

like image 166
Sebastian Brosch Avatar answered Dec 12 '25 08:12

Sebastian Brosch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!