CSS3中calc()函数用法与心得

CSS3中calc()函数用法与心得

回复
  • 康诗淇用户
    [[{"txt": "\u5728\u7f51\u9875\u524d\u7aef\u5f00\u53d1\u4e2d\u6211\u4eec\u7ecf\u5e38\u4f1a\u9047\u5230\u50cfERP\u7ba1\u7406\u540e\u53f0\u9875\u9762\u8fd9\u79cd\u56fa\u5b9a\u5de6\u4fa7\u680f\u53f3\u8fb9\u968f\u6d4f\u89c8\u5668\u5927\u5c0f\u53d8\u5316\u7684\u9875\u9762\u5e03\u5c40\u60c5\u51b5\u3002\u901a\u5e38\u8fd9\u79cd\u60c5\u51b5\u90fd\u662f\u4e0d\u80fd\u7eaf\u7528css\u505a\u7684\uff0c\u90fd\u662f\u91c7\u7528js\u6765\u63a7\u5236\u5b9e\u73b0\u7684\uff0c\u517c\u5bb9\u6027\u4e5f\u5f88\u5f3a\u3002\u4f46\u662f\u6709\u65f6\u5019\u60f3\u505a\u4e2a\u7b80\u5355\u7684\u4e0d\u60f3\u53bb\u5199js\u4ee3\u7801\u65f6\uff0c\u65b0\u51fa\u7684CSS3\u6807\u51c6\u4e2d\u6709\u4e2acalc()\u51fd\u6570\u80fd\u5b9e\u73b0\u4e00\u4e9b\u7b80\u5355\u7684\u8ba1\u7b97\u529f\u80fd\uff0c\u7b80\u5316\u7f51\u9875\u4ee3\u7801\uff0c\u4f18\u5316\u7f51\u9875\u8bfb\u53d6\u901f\u5ea6\u3002\u4e0b\u9762\u662f\u672c\u4eba\u5bf9\u4e8eCSS3\u4e2dcalc()\u51fd\u6570\u5728\u5b9e\u9645\u7f51\u9875\u4ee3\u7801\u7f16\u5199\u4f7f\u7528\u4e2d\u7684\u4e00\u4e9b\u8ba4\u77e5\u548c\u4f7f\u7528\u7ecf\u9a8c\u65b9\u6cd5\u3002"}], [{"txt": ["\u5de5\u5177/\u539f\u6599"]}, {"txt": "HTML\u548cCSS3\u7684\u57fa\u672c\u77e5\u8bc6"}, {"txt": "Dreamweaver\u7f51\u9875\u5f00\u53d1\u7f16\u8f91\u8f6f\u4ef6"}, {"txt": "Chrome\u8c37\u6b4c\u6d4f\u89c8\u5668"}], [{"txt": ["\u65b9\u6cd5/\u6b65\u9aa4"]}, {"txt": "\u6253\u5f00Dreamweaver\u8f6f\u4ef6\uff0c\u65b0\u5efa\u4e00\u4e2a\u7a7a\u767dHTML\u9875\u9762\uff0c\u9875\u9762\u4ee3\u7801\u5982\u4e0b\uff1acalc()\u51fd\u6570\u6d4b\u8bd5html,body,div{\tmargin:0;\tpadding:0;}.left{\tfloat:left;\twidth:200px;\theight:100px;\tbackground:#F63;}.right{\tfloat:left;\twidth: calc(100% - 200px);\theight:100px;\tbackground:#f1f2f4;}calc(100% - 100px)\u5bbd\u5ea6100px\u9ad8\u5ea6\u5728\u6d4f\u89c8\u5668\u4e2d\u8fd0\u884c\u7ed3\u679c\u5982\u4e0b\uff1a"}, {"img": ["https://exp-picture.cdn.bcebos.com/32fbcd41037de1377175900ff6c5cf672b5f2a5b.m2m?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_500%2Climit_1"]}, {"txt": "\u4e0a\u9762\u662f\u7406\u60f3\u7684\u60c5\u51b5\uff0c\u4f46\u662f\u672c\u4eba\u5728\u4f7f\u7528\u4e2d\u5374\u53d1\u73b0\uff0ccalc(100% - 200px)\u4e2d\u7684100%\u867d\u7136\u53ef\u4ee5\u6309CSS3\u4e2d\u5b9a\u4e49\u8bf4\u660e\u7684\u7528100vw\u4ee3\u66ff\uff0c\u4f46\u540c\u6837\u7684\u4ee3\u7801\u5374\u4f1a\u51fa\u626f\u820d\u73b0\u5982\u4e0b\u56fe\u7684\u60c5\u51b5\uff0c\u88ab\u6324\u4e0b\u8fc5\u8d2a\u8d22\u4e00\u884c\u4e86\uff01\u6ce8\uff1a100vw\u6307100%\u7684viewpoint width\u5373\u6d4f\u89c8\u5668\u53ef\u89c6\u533a\u57df\u5bbd\u5ea6\uff0c\u540c\u7406100vh\u6307100%\u7684viewpoint height"}, {"img": ["https://exp-picture.cdn.bcebos.com/e076d77622bc7dc5746499ec5e460596b814295b.m2m?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_500%2Climit_1"]}, {"txt": "\u7ecf\u8fc7\u672c\u4eba\u4ed4\u7ec6\u7814\u7a76\u53d1\u73b0\uff0c\u4f7f\u7528100vw\u65f6\u597d\u50cf\u8c37\u6b4c\u6d4f\u89c8\u5668\u7684\u6eda\u52a8\u6761\u5bbd\u5ea6\u6ca1\u7b97\u8fdb\u53bb\uff0c\u5bfc\u81f4\u5f97\u51fa\u7684\u7ed3\u679c\u8d85\u51fa\u4e86\u6d4f\u89c8\u5668\u53ef\u89c6\u533a\u57df\u5bbd\u5ea6\uff0c\u6240\u4ee5\u5c31\u88ab\u6324\u5230\u7b2c\u4e8c\u884c\u53bb\u4e86\u3002\u89e3\u51b3\u65b9\u8c03\u9500\u6cd5\uff1a1.calc\u8fd0\u7b97\u65f6\u591a\u51cf\u53bb\u4e00\u70b9\u5bbd\u5ea6\uff0810px\u7684\u6eda\u52a8\u6761\u5bbd\u5ea6\uff09\uff0c\u4f46\u4f1a\u5bfc\u81f4\u53f3\u8fb9\u7a7a\u51fa\u4e00\u70b9\u7a7a\u95f4\uff0c\u5f71\u54cd\u7f8e\u89c2\uff1b2.\u4e0d\u8981\u4f7f\u7528100vw\uff0c\u76f4\u63a5\u4f7f\u7528100%"}], [{"txt": ["\u6ce8\u610f\u4e8b\u9879"]}, {"txt": "CSS3\u7684calc()\u51fd\u6570\u53ea\u652f\u6301IE9.0\u4ee5\u4e0a\u7248\u672c"}, {"txt": "\u79fb\u52a8\u7aef\u517c\u5bb9\u6027\u5f88\u5dee\uff0c\u9002\u5408PC\u7aef\u4f7f\u7528"}]]
    2024-11-22
    1楼
    回复

参与评论

游客评论不支持回复他人评论内容,如需回复他人评论内容请