twbs--bootstrap/docs/4.0/utilities/position.md

32 lines
997 B
Markdown
Raw Normal View History

---
layout: docs
title: Position
2017-05-28 18:25:59 +00:00
description: Use these shorthand utilities for quickly configuring the position of an element.
group: utilities
2017-05-28 18:25:59 +00:00
toc: true
---
2017-05-28 18:25:59 +00:00
## Fixed top
Position an element at the top of the viewport, from edge to edge. Be sure you understand the ramifications of fixed position in your project; you may need to add aditional CSS.
{% highlight html %}
<div class="fixed-top">...</div>
{% endhighlight %}
2017-05-28 18:25:59 +00:00
## Fixed bottom
Position an element at the bottom of the viewport, from edge to edge. Be sure you understand the ramifications of fixed position in your project; you may need to add aditional CSS.
{% highlight html %}
<div class="fixed-bottom">...</div>
{% endhighlight %}
2017-05-28 18:25:59 +00:00
## Sticky top
Position an element at the top of the viewport, from edge to edge, but only after you scroll past it. The `.sticky-top` utility uses CSS's `position: sticky`, which isn't fully supported in all browsers.
{% highlight html %}
<div class="sticky-top">...</div>
{% endhighlight %}