头闻号

广州远杨机械设备有限公司

化工原料代理加盟|磺酸|化工成套设备|行业专用设备加工|化工成型设备|化学试剂

首页 > 新闻中心 > 科技常识:css中的四种定位方式示例介绍
科技常识:css中的四种定位方式示例介绍
发布时间:2024-09-22 06:56:12        浏览次数:4        返回列表

今天小编跟大家讲解下有关css中的四种定位方式示例介绍 ,相信小伙伴们对这个话题应该有所关注吧,小编也收集到了有关css中的四种定位方式示例介绍 的相关资料,希望小伙伴们看了有所帮助。

复制代码代码如下: *{ margin:0px; padding:0px; } .div1{ border:1px solid red; background:silver; width:60px; height:30px; float:left; margin-left:5px; } .div2{ position:relative; left:10px; top:10px; width:100px; height:80px; background:pink; float:left; margin-left:5px; } #spe{ position:relative; top:40px; left:20px; } #spe2{ position:absolute; top:40px; left:20px; } #spe{ position:fixed; top:40px; left:20px; } [html] view plaincopy在CODE上查看代码片派生到我的代码片 <html> <head> <link rel="stylesheet"type="text/css"href="https://www.aidi.net.cn//css/position.css"/> </head> <body> <div class="div1">内容1</div> <div class="div1">内容3</div> <div class="div1">内容4</div> <div class="div2"> <div class="div1"id="spe2">内容2</div> </div> </body> </html>

来源:爱蒂网