Недавно у меня был похожий ТАК вопрос с блестящим ответом. Однако этот ответ и этот вопрос не применимы к сегодняшней ситуации. Теперь кнопка имеет текст под ним. Вот код: https://jsfiddle.net/Lo4362rk/
button {
float: right;
position: relative;
right: 10%;
top: 100px;
max-top: 10px;
background-color: green;
}
.third-party-block {
//display: none;
}
и
<div style="border:1px solid red;">
<button>
The main thing in the text is here =>
</button>
<p class="third-party-block">
some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here some text comes here
</p>
</div>
.third-party-block является динамическим и иногда не отображается. В результате родительский элемент становится короче, а кнопка становится за пределами родительского элемента из-за top: 100px;Вопрос заключается в том, как нажать кнопку внутри родительского элемента, скажем, на 10 пикселей сверху (не от 100 пикселей).
Требуется чистое решение CSS.
![enter image description here](https://i.stack.imgur.com/kEdZ3.png)