How to add dynamic CSS using CSS
For example,
two-column are there.
one column’s width set 200px. and which CSS needs to add for the second column so it’s set in one line with responsive.
Add comment
Answers (1)
Add AnswerIf you want which CSS needs to add for the second column so it’s set in one line with responsive so please review the example.
First of all, create HTML in the index.html file.
<body> <div class="row"> <div class="first-col"> <h2>First col</h2> </div> <div class="second-col"> <h2>Second col</h2> </div> </div> </body>
Then add CSS in <style>…</style> tag on index.html file.
.row{ display: flex; } .first-col{ width: 200px; background: #ddd; } .second-col{ width: calc(100% - 200px); background: #eee; }
I have used the calc()function.
Please review the video.
I hope you guys found something useful ??