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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • athena1234
    New Member
    • Dec 2020
    • 1

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

    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:
    Code:
    .topnav { 
    	background-color: #b3e0ff; 
    	color: #ffffff; 
    	height: 8%; 
    	padding-bottom: 20px; 
    	margin-top: 10px; 
    	margin-left: 150px;
    	margin-right: 150px; 
    	margin-bottom: 0px;
    	width: 1200px; 
    	position: sticky; 
    	top: 0; 
    } 
     
    .topnav a { 
    	list-style: none; 
    	display: inline-block; 
    	float: left; 
    	text-decoration: none;
    	text-align: center; 
    	font-size: 25px; 
    	font-family: arial; 
    	color: #ffffff; 
    	padding: 25px 60px;
    	padding-bottom: 25px; 
    	word-spacing: 10px;
    } 
    
    .GriechischeFlagge img { 
    	width: 40px;	
    	height: 35px; 
    } 
    
    .GriechischeFlagge a { 
    	top: -55px; 
    	left: 15px;
    	display: inline-block; 
    	position: sticky;
    } 
    
    .Warenkorb img { 
    	width: 65px; 
    	height: 65px; 
    } 
    
    .Warenkorb a { 
    	top: -55px;
    	left: 35px; 
    	display: inline-block; 
    	position: sticky; 
    }
    Last edited by Niheel; Jan 2 '21, 01:15 PM. Reason: added code tags around the CSS
  • dev7060
    Recognized Expert Contributor
    • Mar 2017
    • 656

    #2
    I believe because of positioning. Maybe provide the minimal code for the other party to be able to reproduce the same result.

    Comment

    Working...