Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Not sure why I can't resize a div?

I am not sure why I can’t resize a basic div.

i create a div and add the following.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="author" content="">
<title>New page</title>
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<div></div>
    div {
    width: 400px;
    height: 400px;
    background-color: orange;
    }

    div :hover {
    width: 600px;
    height: 600px;
    }
<div>
</div>

I looked at example all over the net and this should work but it doesn’t. any help is appreciated.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

There was a typo in your code. Remove the extra space in div :hover as below.

div:hover {
  width: 600px;
  height: 600px;
}
div {
  width: 400px;
  height: 400px;
  background-color: orange;
}

div:hover {
  width: 600px;
  height: 600px;
}
<div>
</div>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading