You can use a CSS hack to acheive this if you really want to use CSS only. First, make the text disappear by setting it to the color of the background. Then use the before and after selectors to rerender the content.
However, easier would be to use span tags in your HTML, then make each of them have display: block to get a line break.
A simple way to approach this – use a width property on a element. Then, by word-break rule (which is ‘normal’ by default and you don’t need to specify this) words will be auto-wrap on next line, when there is no free place on container
I need to move the market word to the bottom and it should be displayed like that:
Düsseldorf
markets
Any idea how can I do it with the help of CSS only(i.e how can I change title CSS class to get desired view)?
Comments
Comment posted by Michael
Thanks for post, But I need the border with the same width
Comment posted by itsanewabstract
@Michael Why not create two separate
Comment posted by Michael
Because I get it as single line
Comment posted by itsanewabstract
@Michael Edited to keep border. But this is more of a hack than a proper solution. Best would be to use
Comment posted by Michael
thanks nice! What if I want to add padding row to the title class:padding: 10px 0px 0px 0px; so I guess padding-right will not work
Comment posted by doğukan
padding: 10px calc(100% - 10ch) 0px 0px;
Comment posted by Michael
Thanks! Seems that it’s new feature
Comment posted by Temani Afif
10 characters doesn’t mean 10ch. It’s only valid for monospace fonts where all the character have the same width equal to the one of 0 that is defining the ch unit
Comment posted by doğukan
@TemaniAfif oh thanks. I have never ever heard that.