[html] Inline elements shifting when made bold on hover

I've combined a bunch of the techniques above to provide something that doesn't totally suck with js turned off and is even better with a bit of jQuery. Now that browsers support for subpixel letter-spacing is improving, it's really nice to use it.

_x000D_
_x000D_
jQuery(document).ready(function($) {_x000D_
  $('.nav a').each(function(){_x000D_
      $(this).clone().addClass('hoverclone').fadeTo(0,0).insertAfter($(this));_x000D_
    var regular = $(this);_x000D_
    var hoverclone = $(this).next('.hoverclone');_x000D_
    regular.parent().not('.current_page_item').hover(function(){_x000D_
      regular.filter(':not(:animated)').fadeTo(200,0);_x000D_
      hoverclone.fadeTo(150,1);_x000D_
    }, function(){_x000D_
      regular.fadeTo(150,1);_x000D_
      hoverclone.filter(':not(:animated)').fadeTo(250,0);_x000D_
    });_x000D_
  });_x000D_
});
_x000D_
ul {_x000D_
  font:normal 20px Arial;_x000D_
  text-align: center;_x000D_
}_x000D_
li, a {_x000D_
  display:inline-block;_x000D_
  text-align:center;_x000D_
}_x000D_
a {_x000D_
  padding:4px 8px;_x000D_
  text-decoration:none;_x000D_
  color: #555;_x000D_
}_x000D_
_x000D_
.nav a {_x000D_
  letter-spacing: 0.53px; /* adjust this value per font */_x000D_
}_x000D_
.nav .current_page_item a,_x000D_
.nav a:hover {_x000D_
  font-weight: bold;_x000D_
  letter-spacing: 0px;_x000D_
}_x000D_
.nav li {_x000D_
  position: relative;_x000D_
}_x000D_
.nav a.hoverclone {_x000D_
  position: absolute;_x000D_
  top:0;_x000D_
  left: 0;_x000D_
  white-space: nowrap;_x000D_
}
_x000D_
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>_x000D_
<ul class="nav">_x000D_
  <li><a href="#">Item 1</a></li>_x000D_
  <li><a href="#">Item 2</a></li>_x000D_
  <li class="current_page_item"><a  href="#">Item 3</a></li>_x000D_
  <li><a href="#">Item 4</a></li>_x000D_
  <li><a href="#">Item 5</a></li>_x000D_
</ul>
_x000D_
_x000D_
_x000D_

Examples related to html

Embed ruby within URL : Middleman Blog Please help me convert this script to a simple image slider Generating a list of pages (not posts) without the index file Why there is this "clear" class before footer? Is it possible to change the content HTML5 alert messages? Getting all files in directory with ajax DevTools failed to load SourceMap: Could not load content for chrome-extension How to set width of mat-table column in angular? How to open a link in new tab using angular? ERROR Error: Uncaught (in promise), Cannot match any routes. URL Segment

Examples related to css

need to add a class to an element Using Lato fonts in my css (@font-face) Please help me convert this script to a simple image slider Why there is this "clear" class before footer? How to set width of mat-table column in angular? Center content vertically on Vuetify bootstrap 4 file input doesn't show the file name Bootstrap 4: responsive sidebar menu to top navbar Stylesheet not loaded because of MIME-type Force flex item to span full row width

Examples related to hover

Angular 2 Hover event How can I access a hover state in reactjs? CSS disable hover effect How to remove/ignore :hover css style on touch devices Spin or rotate an image on hover How to make in CSS an overlay over an image? How to display and hide a div with CSS? simple Jquery hover enlarge Changing image on hover with CSS/HTML CSS On hover show another element

Examples related to text-size

Text size of android design TabLayout tabs Different font size of strings in the same TextView Text size and different android screen sizes What is the default text size on Android? How to assign text size in sp value using java code Inline elements shifting when made bold on hover