Home > Enterprise >  External and internal CSS styles at the same time?
External and internal CSS styles at the same time?

Time:10-21

I working with images at this moment, in my html document. A don't want, that adjust image width for each img element, so I made separated class (for e. thumbnail) for img tag in my style.css, but that doesn't works. Then I'd created style in my head tag, and placed the thumbnail class in there. That works, but now my style.css doesn't works at all. What I should do?

EDIT:
Working example:
index.html:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>Document</title>
</head>
<body>
    <div >
        <div >
            <div >
                <a href="@">
                    <img src="plug.png" >
                </a>
            </div>
        </div>
    </div>
</body>
</html>

style.css:

body{
    margin: 0px;
    font-family: Arial, Helvetica, sans-serif;
}
.thumbnail{
    width: 30px;
    height: auto;
}

CodePudding user response:

link should have a href instead of src

<link rel="stylesheet" type="text/css" href="style.css">

  • Related