Cześć!
Dopiero uczę się na własną rękę, robić proste strony internetowe, więc proszę o wyrozumiałość jeśli pytanie jest banalne :)
Otóż robię animację strzałki, która dzięki hover , po najechaniu zmienia kolor. Kiedy ustawiam transition, czyli ustalam czas i sposób zmiany, pojawia się problem.
Mianowicie odświeżając stronę po zapisaniu linijki kodu z transition:
strzałka zamiast być w tym samym miejscu, wykonuje jakby powolne pojawianie się od prawej stronie i jakby wyrasta w kierunku miejsca docelowego, gdzie od początku powinna być. i dalej po najechaniu kursorem zachowuje się już tak jak powinna.
Będę wdzięczna za pomoc, na dole wstawiam kod :)
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
html {
font-size: 10px;
}
header {
height: 100vh;
width: 100%;
background-color: darkcyan;
position: fixed;
top: 0;
left: 0;
overflow-x: hidden;
z-index: 1;
}
main {
height: 100vh;
background-color: darkgrey;
margin-top: 100vh;
position: relative;
z-index: 2;
}
header img {
position: absolute;
bottom: 50px;
height: 60vh;
left: 50%;
transform: translateX(-50%);
}
header nav {
position: absolute;
right: 8%;
top: 5%;
font-size: 4rem;
}
header hgroup {
position: absolute;
top: 16%;
left: 12%;
}
header h1 {
font-size: 4rem;
}
header h3{
font-size: 2rem;
font-weight: 300;
}
#arrow {
width: 50px;
height: 50px;
border: 5px solid white;
position: absolute;
bottom: 2%;
left: 50%;
transform: translateX(-50%);
border-radius: 50%;
font-size: 5rem;
text-align: center;
text-shadow: 0 -8px 0 black, 0 -18px 0 black;
overflow: hidden;
transition: 1s;
}
#arrow:hover {
text-shadow: 0 -8px 0 white, 0 -18px 0 white;
color: white;
border-color: black;
}
@media (orientation: portrait) {
h3 span::after {
content: '\A';
white-space: pre;
}
}
@media (max-width: 320px) {
header h1 {
font-size: 2.5rem;
}
header h3 {
font-size: 1.8rem;
}
}
@media (min-width: 1024px) {
header h1 {
font-size: 8rem;
}
header h3 {
font-size: 6rem;
}
#arrow {
width: 70px;
height: 70px;
font-size: 7rem;
}
}