Context: (simplified)
<div style="width:300px;" >
<img src="blabla..." />
<div style="oveflow:hidden; etc..." >
description
</div>
</div>
Problem:
Sometimes the description can be very long and gets cut (intended, see "overflow:hidden;"). So I made it so that when the user hover the description a css animation pushes the description to the left side a bit, let's say "margin-left:-200px;". This way the user can continue reading the description while it reveals itself (css animate).
Now comes the issue: the description can vary from long to very long to very very long. And obviously pushing it to the left for -200px is sometimes not enough, sometimes too much.
Solutions I know:
1)
Javascript/jQuery
My website is full non-js and very lightweight, I do not want to use js. I found many solutions on the web using js, I already know them. Please respect this. I would love to solve it via pure css.
2)
<marquee>description</marquee>
Depreciated.
Ideas:
I was thinking about "tricking" it using PHP code. For example I would calculate the description's length so that I could set a "margin-left:-???px;" accordingly. Now that sounds even uglier than js to me, forcing me to "hardcode" it in the php file bypassing the conveniant css stylesheet and resulting in a heavy php file. Irrelevant.
I didn't find anything in the CSS3 about it eventhough many other designers came accross this issue from what I could find searching on GG. Is it beyond css language's scope?
Thank you.
PS: my description MUST fit in 1 line. No line break, no scrollbar, no "show more" button, etc.