You would need to have some inner containers. inside div oval_gray, place 2 divs. One to hold the text and one to hold the detail buttons. set text-align:justify
Using display: table/table-row/table-cell on various elements.
A container for the divs as table, the divs as table-row then spans for the line of text and ‘Details’ buttons as table-cell.
That should keep it all in a table like grid formation without having to use actual tables.
It could also be done by floating the buttons to the right. Or for a more modern solution, it could be done with flex-box.
I don’t think that I would have used DIVs to wrap what it looks to me a paragraph. But can I ask why did you a absolute position when you don’t have anything else positioned, not to say absolutely?
Because you are not using position for anything else, the position itself will be in relation to the HTML element.
And besides… you’re not taking advantage of the absolute position… because you don’t tell the item where it should be. You just use the margin instead of left (position should go with left and top, left and bottom, right and top or any other combination)
Also, I wouldn’t use SPAN for note. It is obviously that you’re emphasazing the word, therefore that should be a EM element to my eyes. Then you can style it the way you want.
This example uses Flex.
I first tried with display table, but struggled to get the spacing between rows like you have, sure there is a way I’m missing.
It also takes on the comments by @molona about the elements you use and removes all the nasty in-line styling to use just one class attribute for the whole thing for super slim html.
This is pretty impressive CSS level stuff.
I am afraid this level of CSS is above my comfort level, as I was looking for suggestion within the CSS framework we are working with, which obviously is not as high a level as yours
Wish you all working for us as Volunteers. Alas you are not
OTN, do you have a CSS book to read which would give one the Super High level CSS knowledge that you have.
out of interest i wondered what i would have done if i had to do this quickly. I am certainly far from an expert so i am only posting this to show the difference in the way i did it and perhaps learn to do it better from showing my workings. The main difference i note in what i have done is that when the screen resizes my end button moves underneath. any comments on whether my solution is passable,ok,just another way of doing it, terrible, awful (and why) could be interesting (or make me cry).
As with other examples it will put the details at the far right of the line.
Or you could position it to the right with right:0 and absolute positioning but you will need to make sure the line is padded at the end to protect the absolute element.