html - How do I make my images scaleable and at the same time maintain their aspect ratio? -


i'm working on website , i've been designing on samsung 22 inch monitor. haven't been playing resizing window, designing site window @ full screen. made image slider on homepage , noticed images in slider scale down while maintaining aspect ratio when resize window images not in slider created fit appropriately in full screen mode remain same size when i'm resizing window messes layout. haven't done css on images except changing margins there can css tell images scale images when resizing window.

css code images

.project-section  img{    display:inline;    margin-top: -18px;    margin-bottom: -5px;    margin-left: -8px; } 

css code image slider got tutorial i'm still trying understand images here scale when resizing thed window.

          @keyframes slidy {            0% { left: 0%; }            20% { left: 0%; }            25% { left: -100%; }            45% { left: -100%; }            50% { left: -200%; }            70% { left: -200%; }            75% { left: -300%; }            95% { left: -300%; }           100% { left: -400%; }             }     div#slider { overflow: hidden; }   div#slider figure img { width: 20%; float: left; }   div#slider figure {     position: relative;    width: 500%;    margin: 0;    left: 0;    text-align: left;    font-size: 0;    animation: 40s slidy infinite;   } 

image scaling while preserving ratio css works specifying 1 of width or height (depending on 1 know) , set other 1 auto. if responsive design asks images 480px wide, be:

width: 480px; height: auto; 

Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -