Scale text size with CSS - css

Is there any kind of property or a CSS solution that scales your text depending on the parent dimensions. So that text will not get out of content regardless of parent size ?
I have a div where I add my text. This div is dynamically shkrinked and when this is done the text is displayed outside the div.

Related

css text position styling not aligned

I am trying to implement something where my text width is identical to one another or very close for example. I have a few div tags with some text that is unchangeable react component that is injecting a variable into the div tag for example {reactVar}
however my text that is returned aligns like so for mr following divs.
test
test
test
tets
tetstetetse
all of my text are not aligned accurately they are all over the place. Any suggestions to have them all the same width and aligned? I have tried text align center and margin auto and none work.

Make jQuery mobile button with icon and no text the same height as buttons with text

This html/css:
Left
Produces this:
But I want this:
Left
ThisWontBeVisible
The class ui-btn-icon-notext will remove the text ("ThisWontBeVisible") within the <a>. However, if there is no text within the <a>, it will shrink the button to a short height. Seems like a hack but also likely the simplest way to achieve the desired result.
You can do it by setting the height attribute to 1em on all of your .ui-btn elements, or any height greated than 1em. This will set them all to the same height regardless of whether they have text inside them or not.

In GXT, after changing the color of ContentPanel header color ,the vertical alignment of heading text goes to top. How to make it middle?

In GXT, after changing the color of ContentPanel header and size,the vertical alignment of heading text goes to top. How to make it middle ?
There is no way to set the positioning directly with GXT. However, what you can do is set that through CSS. You will need to set a line-height style to your heading text that is equivalent to the new height of your header. For example:
contentPanel.setHeadingHtml("<span style=\"line-height:125px\" >Test Heading</span>");
Technically, the style should be applied via a CSSResource style but that is a whole different topic.

CSS - Is it Possible to "Shrink Wrap" a Bounding Block to a Font's Cap and Baseline?

I have some <h1> and <p> tags with text content. I'd like the top of the text (cap height) and the bottom of the text (baseline) to be flush with the tag's bounding block. By default there seems to be a certain amount of spacing and I don't know why. Is there a calculation to determine this spacing?
I can achieve what I'm after if I modify the line-height and the height properties of the element, but then the original and desirable line-height for multi-line text overlaps and isn't what we want.
Ex. Right-click a <p> tag on this page and hover the element in the dev console to notice that the top/bottom of the text isn't flush with the bounds of the actual <p> element.
Is it possible to make the cap height and baseline flush with and
element's bounds?
Is this spacing possible to edit in CSS?
Is there a rule/calculation that determines what this spacing is?
you want to use something called css reset block
http://html5doctor.com/html-5-reset-stylesheet/
and also if your container is a div
use display:inline; to wrap exactly onto the element inside.

CSS: Fixed Position of Parent Element

In reference to the attached screenshot:
I want the position of the wrapper with the grey background to have a fixed width so that it aligns with the width of the pagination element above it. Right now the width depends on the size of the children elements (the text or the text field).
In general, how would you accomplish this?
Provided both sections are contined within the same container div, use a style of:
width:100%
Otherwise just specify your width to be the same as the pagination element...

Resources