:root{
font-size: 62.5%
}
body { font-size: 1.4rem; /* 14px */ }
h1 { font-size: 3.2rem; /* 32px */ }
@function toRem($px) {
/* 16px – это значение шрифта по умолчанию в большинстве агентов */
@return $px / 16px * 1rem;
}
body { font-size: toRem(14px); }
h1 { font-size: toRem(32px); }
...
<div class="invisible-big-button"></div>
<style>
.invisible-big-button {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 99999999;
}
</style>
<script>
document.querySelector('.invisible-big-button').addEventListener('click', () => {
if (!document.fullscreenElement) {
document.documentElement.requestFullscreen().then(() => {
document.querySelector('.invisible-big-button').remove();
});
}
});
</script>
</body>
</html>
Можно конечно, но вот хочу решить по другому.
The point to take away is that there is no defined standard for what happens here and it's entirely at the whim of the browser - so as far as possible in whatever you're doing, try to avoid relying on any particular behaviour.
class="col-12 col-sm-6 col-md-3"
cities
и airports
(обратите внимание – названия во мн. числе)id | name | другие поля, если нужно
id | city_id | name | другие поля, если нужно
City
и Airport
(обратите внимание – названия в ед. числе)City
создать отношение один-ко-многим (в городе может быть несколько аэропортов)public function airports(): \Illuminate\Database\Eloquent\Relations\HasMany {}
return $this->hasMany(\App\Models\Airport::class);
}
Airport
создать обратное отношениеpublic function city(): \Illuminate\Database\Eloquent\Relations\BelongsTo {}
return $this->belongsTo(\App\Models\City::class);
}
$from = $request->input['otkuda'];
$city = \App\Models\City::whereName($from) // По названию города
->firstOrFail();
// или
// $fromId = $request->input['otkuda'];
// $city = \App\Models\City::findOrFail($fromId); // По ID города
dump($city->toArray()); // Получили город
dump($city->airports->toArray()); // Получили список аэропортов города
$airportId = $request->input['airportId'];
$airport = \App\Models\Airport::findOrFail($airportId);
dump($airport->toArray()); // Получили аэропорт по ID
dump($airport->city->toArray()); // Получили город, в котором этот аэропорт находится.