-
Notifications
You must be signed in to change notification settings - Fork 708
[css-inline] textBottom property #4582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@oleedd Can you explain a bit more what the problem is you're trying to solve? |
@oleedd http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Cp%20style%3D%22border%3A%201px%20solid%3B%20height%3A%204px%3B%20line-height%3A%200%3B%20padding-top%3A%204px%22%3EText%3C%2Fp%3E should work, but I still don't understand what you're trying to accomplish. |
If I understand correctly, you're looking for something like the box alignment properties, which are still not fully supported for regular paragraph text, but which would give a lot of control over how content is aligned within a container. You can almost get what you want with
The grid on the paragraph is there to force it to treat the child text content as a separate layout block and to increase support for the The But that fits the end of the full height of the text line to the bottom of the container, including “descenders” on the letters. I can't think of a way to get the baseline to align exactly with the border bottom. Could you give a larger example of a design that needs this type of overflow & alignment? Why is the paragraph constrained to a shorter height than the text? Why is the overflow needed at the top? How should it behave if there are multiple lines of text? Without knowing those things, we cannot discuss a general solution. |
@oleedd Still don't entirely understand what you're trying to do at a higher level. Can you please post some real-world examples where this is needed to accomplish a particular desired layout? Diagramming isn't helping to understand the use case. |
In the above "larger example", |
@oleedd Still don't understand. Can you maybe screenshot or photograph an example of an actual page layout that you're trying to achieve in CSS? |
I don't have that. |
@oleedd Well... our job is to make use cases possible, not to create technology as a theoretical exercise. So if there's no use case, it's not worth spending time to address. |
It is just about to make |
Unfortunately, not exactly. It would require significant revision of the way how CSS controls the vertical position of the glyphs (which might be rather counter-intuitive, I admit). To some extent, for the single-line text, the example from the initial post seems to be achievable by setting the line-height to zero (to make both above-baseline and below-baseline parts of the text "stick out" from the container) and adding an inline-block placeholder pseudo-element to push the baseline down by the needed length (example). That said. this issue shows another example of authors' common need to access and control the exact geometric position of the rendered text and is likely related to #4792. |
@SelenIT |
That's why I added "to some extent" :(. Unfortunately, this method has a limitation that the middle point of the glyphs can't be above the top edge of the container, i.e., it breaks when the container height is less than ascender - (ascender + descender)/2. (Please also note that ascender and descender are abstract metrics of the font and don't necessarily match the actual size of the corresponding character parts.) |
If you don't know - then it is useless and need to remove it. And that will solve this and similar issues. |
That issue was closed. Is there anything new in css to solve this? |
When

font-size
is bigger than elementheight
. Only one element (div
) is used. Expected result:Should work at any
font-size
.The text was updated successfully, but these errors were encountered: