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
1. To develop web responsively, the page must ada...
Overview Today I will mainly share how to correct...
1. flex-direction: (direction of element arrangem...
As shown below: select a1,a2,a1+a2 a,a1*a2 b,a1*1...
According to the principles of W3C, each start tag...
This article shares the specific code for impleme...
1. Download the mysql-5.7.17-winx64.zip installat...
1. Create the MySQL database nacos_config 2. Sele...
Let's imitate Taobao's function of displa...
Sophie Hardach Clyde Quay Wharf 37 East Soapbox Rx...
1. Use ansible's playbook to automatically in...
Table of contents 1 Difference 1.1 Space Occupanc...
In fact, this is very simple. We add an a tag to ...
Trident core: IE, MaxThon, TT, The World, 360, So...
CSS3 can create animations, which can replace man...