How to use CSS position sticky to keep a sidebar visible with Bootstrap 4

In the stable Bootstrap 4.0.0 release, this is done using the sticky-top class… Demo <div class=”container”> <nav class=”navbar navbar-light bg-light navbar-expand”> <a class=”navbar-brand” href=”#”>Header</a> … </nav> <div class=”row”> <div class=”col-8 content”> Content </div> <div class=”col-4″> <div class=”sticky-top”> <h4>Sticky menu</h4> … </div> </div> </div> <div class=”footer”> … </div> </div> This works even in the height of … Read more

How to work with ellipsis in bootstrap responsive table

The text-overflow property only affects content that is overflowing a block container element in its inline progression direction MDN For text-overflow to work, specifying text-overflow: ellipsis alone will not do any good – you should use the following styles together: overflow: hidden; white-space: nowrap; text-overflow: ellipsis; span, div, th, td { overflow: hidden; white-space: nowrap; … Read more

How can I make the contents of a fixed element scrollable only when it exceeds the height of the viewport?

You probably can’t. Here’s something that comes close. You won’t get content to flow around it if there’s space below. .stuck { position: fixed; top: 10px; left: 10px; bottom: 10px; width: 180px; background-color: #eee; overflow-y: scroll; } .stuck p { margin: 10px; } .not-stuck { margin-left: 200px; } <div class=”stuck”> <p>Lorem ipsum dolor sit amet, … Read more

position relative in firefox [duplicate]

position: relative does not work on table cells (<td> or display: table-cell). From the spec: http://www.w3.org/TR/CSS21/visuren.html#propdef-position The effect of ‘position:relative’ on table-row-group, table-header-group, table-footer-group, table-row, table-column-group, table-column, table-cell, and table-caption elements is undefined. So, Firefox is doing nothing wrong, although I do wish it would copy other browsers and make this work. To make this … Read more

position:fixed when left/top/right/bottom aren’t specified – desired results in FF/IE, but not in Safari

I believe the answer you’re looking for is as follows… The position of an element does not default to 0,0. It’s position is set by default relative to the containing element, therefor in your example, “#container-1” has a padding-left: 20px whereas the rest of the padding is set to 0 making the “default” position of … Read more