468,291 Members | 1,670 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,291 developers. It's quick & easy.

Why is it not possible to move images with my css code?

1 Bit
I wanted to have a navigation bar with images but it seems impossible to position the images in the navigation bar. Iused two images and even though I used the same code, the second one doesn´t move. I also tried changing the positions to absolute and relative, but nothing changed for the second image.

This is my code in css:
Expand|Select|Wrap|Line Numbers
  1. .topnav { 
  2.     background-color: #b3e0ff; 
  3.     color: #ffffff; 
  4.     height: 8%; 
  5.     padding-bottom: 20px; 
  6.     margin-top: 10px; 
  7.     margin-left: 150px;
  8.     margin-right: 150px; 
  9.     margin-bottom: 0px;
  10.     width: 1200px; 
  11.     position: sticky; 
  12.     top: 0; 
  13.  
  14. .topnav a { 
  15.     list-style: none; 
  16.     display: inline-block; 
  17.     float: left; 
  18.     text-decoration: none;
  19.     text-align: center; 
  20.     font-size: 25px; 
  21.     font-family: arial; 
  22.     color: #ffffff; 
  23.     padding: 25px 60px;
  24.     padding-bottom: 25px; 
  25.     word-spacing: 10px;
  26.  
  27. .GriechischeFlagge img { 
  28.     width: 40px;    
  29.     height: 35px; 
  30.  
  31. .GriechischeFlagge a { 
  32.     top: -55px; 
  33.     left: 15px;
  34.     display: inline-block; 
  35.     position: sticky;
  36.  
  37. .Warenkorb img { 
  38.     width: 65px; 
  39.     height: 65px; 
  40.  
  41. .Warenkorb a { 
  42.     top: -55px;
  43.     left: 35px; 
  44.     display: inline-block; 
  45.     position: sticky; 
  46. }
Dec 28 '20 #1
1 1322
dev7060
419 Expert 256MB
I believe because of positioning. Maybe provide the minimal code for the other party to be able to reproduce the same result.
Dec 29 '20 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

10 posts views Thread by Tobias Nilsson | last post: by
8 posts views Thread by Amanda H. | last post: by
1 post views Thread by John Dalberg | last post: by
3 posts views Thread by animation | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.