Skip to content

Instantly share code, notes, and snippets.

@kupereal
Created April 30, 2026 12:46
Show Gist options
  • Select an option

  • Save kupereal/92262623febb31c7d1de3fece6fad312 to your computer and use it in GitHub Desktop.

Select an option

Save kupereal/92262623febb31c7d1de3fece6fad312 to your computer and use it in GitHub Desktop.
Встраивание SVG-логотипа
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Встраивание SVG-логотипа</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="wrapper">
<div class="container">
<a href="/" class="logo-svg" aria-label="На главную"></a>
<div class="content">
<h1>Lorem ipsum</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
</div>
</div>
</body>
</html>
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background-color: aquamarine;
font-family: Helvetica, sans-serif;
}
.wrapper {
background-color: aqua;
margin: 80px 0;
padding: 30px 0;
}
.container {
display: flex;
width: 70%;
margin: 0 auto;
align-items: center; /* Центрирование логотипа и текста по вертикали */
gap: 40px; /* Отступ между логотипом и текстом */
}
.logo-svg {
flex: 0 0 30%;
aspect-ratio: 3261.5 / 930; /* Точные пропорции нашего SVG-файла (из viewBox) */
background: url('logo.svg') no-repeat center / contain;
transition: transform 0.3s ease, filter 0.3s ease; /* Плавный эффект при наведении */
cursor: pointer;
}
.logo-svg:hover {
transform: scale(1.05); /* Легкое увеличение */
filter: brightness(1.1); /* Небольшое осветление */
}
.content {
flex: 0 0 70%;
font-size: 16px;
line-height: 1.6;
color: #333;
}
@media only screen and (max-width: 768px) {
.container {
flex-direction: column; /* Складываем макет в колонку */
width: 90%;
text-align: center;
}
.logo-svg {
flex: 0 0 auto;
width: 60%; /* На мобильных логотип покрупнее */
margin-bottom: 20px;
}
.content {
flex: 0 0 auto;
width: 100%;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment