«отсортировано» в iOS 9 & amp; xcode 7.3, swift 2.2 невозможно, измените «отсортированный» на «sort», например:
let dictionary = ["main course": 10.99, "dessert": 2.99, "salad": 5.99]
let sortedKeysAndValues = Array(dictionary).sort({ $0.0 < $1.0 })
print(sortedKeysAndValues)
//sortedKeysAndValues = ["desert": 2.99, "main course": 10.99, "salad": 5.99]
добавить тег к h1 ...
.container {
width: 500px;
margin: 0 auto;
border: solid 1px red;
padding: 1em;
}
.container h1 {
max-width: 350px;
position: relative;
}
.container--1 h1::after {
content: 'Beginner';
}
.container--1 h1::after,
.container .difficulty {
font-size: 1rem;
padding: .25rem;
border: solid green 1px;
margin-left: 1rem;
position: absolute;
z-index: 1;
right: 1px;
bottom: 1px;
}
<div class="container container--1">
<h1>Here is a long title with a pseudo element tag</h1>
</div>
<div class="container container--2">
<h1>Here is a long title with a pseudo element tag
<span class="difficulty">Beginner</span>
</h1>
</div>
Вы можете просто включить его в заголовок:
<h1>Here's a multi-line title...<span class="difficulty">Beginner</span></h1>
Если вы не хотите иметь дополнительные текст в заголовке, вы можете сделать заголовок inline
.
Проверьте мой обновленный форк, используя ваш псевдоэлемент:
https://codepen.io/kirapwn/pen/LMaOEG
position: absolute;
bottom: 0;
right: 0;
transform: translateX(100%);
и `position: относительно '