In the latest HTML standard, there is a calc CSS expression that we can use to calculate the layout. But it is not supported in the old IE. In order to support all browsers, js is used here. screenshot: ![]() code: Copy code The code is as follows:<!DOCTYPE HTML PUBLIC "-//IETF//DTD LEVEL1//EN"> <html> <head> <title>MyHtml.html</title> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="this is my page"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <script> var left,center,right,width; window.onload = function(){ left=$('left'); center=$('center'); right=$('right'); onresize(); }; window.onresize = function() { try { width = document.body.clientWidth; center.style.width = (width - left.clientWidth - right.clientWidth - 0) + "px"; }catch(e){ //If it is less than 0, an error will be reported } }; function $(id){ return document.getElementById(id); } </script> <style> body,html{ height:100%; margin:0px; padding:0px; overflow:hidden; } #left,#center,#right width:200px; height:100px; background-color:rgb(34,124,134); float:left; height:100%; } #center{ background-color:red; } </style> </head> <body> <div id="left"></div> <div id="center"></div> <div id="right"></div> </body> </html> |
<<: PHP-HTMLhtml important knowledge points notes (must read)
>>: Vue achieves the top effect through v-show
Customizing images using Dockerfile Image customi...
I am planning to organize the company's inter...
The players we see on the web pages are nothing m...
Brief review: Browser compatibility issues are of...
1. Preparation before installation: 1.1 Install J...
The mobile version of the website should at least...
1. Confirm whether MySQL has been installed. You ...
Some fault code tables use the following design p...
Table of contents 1. Environmental Installation 2...
The blogger hasn't used MySQL for a month or ...
Scary, isn't it! Translation in the picture: ...
I have roughly listed some values to stimulate ...
The crontab command is used by Unix and Linux to ...
What are HTTP Headers HTTP is an abbreviation of ...
1. Introduction MySQL locks can be divided into g...