Answers for "css for responsive div"

1

how to make a div responsive in css

Use %.
% takes the x% space of the parent element.
example:
This div will have the same width as the body, which is usually the whole page.
<style>
	div{
  	width:100%;
  	}
</style>
<body>
	<div></div>
</body>
Posted by: Guest on June-26-2021
0

how to make body width be device width html

<meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
Posted by: Guest on September-22-2020

Browse Popular Code Answers by Language