I'm trying to write breadcrumbs that are left-aligned, but get pushed out on the left if they are too long.
Small visualization:
| Breadcrumb1 > Breadcrumb2 |
But then
| umb3 > Breadcrumb4 > Breadcrumb5 |
I have heard about direction: rtl;
(from https://stackoverflow.com/a/218071/1274761), but this makes the text in the first "picture" right aligned.
I also tried to work with two divs, but I couldn't get it to work either.
I would rather not use a JS based solution, because the breadcrumbs are rather dynamic in size (texts get loaded asynchronously).
Is there a pure HTML/CSS solution that would achieve what I'm trying to do?
Edit
This is what I have tried:
<html>
<head>
<style>
.outer {
overflow: hidden;
position: relative;
height: 50px;
}
.inner {
white-space: nowrap;
position: absolute;
right: 0;
max-width: 100%;
}
</style>
</head>
<body>
<div class="outer">
<div class="inner">
asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf adsf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
</div>
</div>
</body>
</html>
But it aligns the text to the right, which is not what I want.