Как передвинуть img
Как передвинуть img
Как я не пытался не padding, не margin, не right left не работали
.apps {
left: 40%;
top: 25%;
position: fixed;
}
.toppanel {
right: 1%;
top: 3%;
position: fixed;
font-size: 16px;
color: #3d3d3d;
cursor: pointer;
padding-right: 100px;
font-family: arial, sans-serif;
}
.toppanel a {
padding-left: 15px;
}
.toppanel :hover {
color: #a8a8a8;
text-decoration: underline;
}
<div class="toppanel">
<img src="https://www.flaticon.com/svg/static/icons/svg/56/56844.svg" alt="aaa" width="20" height="20" class="apps">
<a>Gmail</a>
<a>Images</a>
</div>
Ответы (3 шт):
Автор решения: DiD
→ Ссылка
.apps {
left: 0;
top: 0;
float: right;
width: 24px;
height: 24px;
position: static;
display: inline-block;
padding: 3px;
margin: 3px;
}
.apps:hover {
filter: drop-shadow(0px 0px 6px red);
}
Автор решения: Михаил Камахин
→ Ссылка
body {
position: relative;
}
.toppanel {
position: fixed;
top: 0;
left: 0;
width: 100%;
display: flex;
justify-content: flex-end;
padding: 30px 0;
font-size: 16px;
color: #3d3d3d;
cursor: pointer;
font-family: arial, sans-serif;
}
.toppanel > * + * {
margin-left: 20px;
}
.toppanel:hover {
color: #a8a8a8;
text-decoration: underline;
}
<div class="toppanel">
<a>Gmail</a>
<a>Images</a>
<img src="https://www.flaticon.com/svg/static/icons/svg/56/56844.svg" alt="aaa" width="20" height="20" class="apps">
</div>
Автор решения: Air
→ Ссылка
такие простые задачи решают grid или flex
.toppanel {
right: 1%;
top: 3%;
position: fixed;
padding-right: 100px;
display: flex;
}
a {
margin: 0 5px;
}
img {
margin: 0 0 0 45px;
}
<div class="toppanel">
<a>Gmail</a>
<a>Images</a>
<img src="https://www.flaticon.com/svg/static/icons/svg/56/56844.svg" alt="aaa" width="20" height="20" class="apps">
</div>
