JSFiddle - React, Tailwind, and code Playground
by Sergey khorev
HTML
<section class="vacancies">
<div class="container">
<h1 class="vacancies__title">Наши вакансии</h1>
<div class="vacancies__list">
<?php while ($vacancy = $res->GetNext()): ?>
<div class="vacancy-card">
<h2 class="vacancy-card__title"><?= $vacancy['NAME_VACANCIES'] ?></h2>
<div class="vacancy-card__salary"><?= $vacancy['MONEY'] ?></div>
<div class="vacancy-card__details">
<span class="vacancy-card__time"><?= $vacancy['TIME_WORK'] ?></span>
<span class="vacancy-card__experience">Опыт: <?= $vacancy['SKILL'] ?></span>
</div>
<div class="vacancy-card__description"><?= $vacancy['ADD_INFO'] ?></div>
<?php if (!empty($vacancy['FILE'])): ?>
<a href="<?= CFile::GetPath($vacancy['FILE']) ?>" class="vacancy-card__file" download>Скачать описание</a>
<?php endif; ?>
<button class="vacancy-card__apply">Откликнуться</button>
</div>
<?php endwhile; ?>
</div>
</div>
</section>
CSS
.vacancies {
padding: 60px 0;
background-color: #f5f5f5;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 15px;
}
.vacancies__title {
font-size: 36px;
text-align: center;
margin-bottom: 40px;
}
.vacancies__list {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 30px;
}
.vacancy-card {
background-color: #ffffff;
border-radius: 8px;
padding: 24px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease;
}
.vacancy-card:hover {
transform: translateY(-5px);
}
.vacancy-card__title {
font-size: 24px;
margin-bottom: 12px;
}
.vacancy-card__salary {
font-size: 20px;
font-weight: bold;
color: #4CAF50;
margin-bottom: 16px;
}
.vacancy-card__details {
display: flex;
justify-content: space-between;
margin-bottom: 16px;
font-size: 14px;
color: #666;
}
.vacancy-card__description {
margin-bottom: 20px;
font-size: 16px;
line-height: 1.5;
}
.vacancy-card__file {
display: inline-block;
margin-bottom: 20px;
color: #2196F3;
text-decoration: none;
}
.vacancy-card__apply {
display: block;
width: 100%;
padding: 12px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.vacancy-card__apply:hover {
background-color: #45a049;
}