M
M
MIKHAN_GO2020-11-01 19:34:07
css
MIKHAN_GO, 2020-11-01 19:34:07

Unable to scale image in css?

I can’t scale the image in css, I don’t know how it can be scaled, I tried everything, I need to reduce it to block size 5f9ee2d2ed682412085129.png, how to do this?

header{
    height: 162px;
    background: rgb(51, 74, 113);

    .logo{
        width: 100%;
        height: auto;
    }
}

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="shortcut icon" href="img/main.ico" type="image/x-icon">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
    <link rel="stylesheet" href="css/main.min.css">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.1/css/all.css" integrity="sha384-vp86vTRFVJgpjF9jiIGPEEqYqlDwgyBgEF109VFjmqGmIY/Y4HV4d3Gp2irVfcrp" crossorigin="anonymous">
</head>
    <body>
        <header>
            <div class="container">
                <div class="logo">
                    <img src="img/logo.jpg" alt="logo">
                </div>
            </div>
        </header>
    </body>
</html>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Lord_Dantes, 2020-11-01
@MIKHAN_GO

max-width

D
Dan500, 2020-11-01
@Dan500

Why 100% width? 100% is the image size. Give the image a height of 162px.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question