日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學(xué)無(wú)先后,達(dá)者為師

網(wǎng)站首頁(yè) 編程語(yǔ)言 正文

css absolute絕對(duì)定位 讓 top 和bottom 同時(shí)生效

作者:yunchong_zhao 更新時(shí)間: 2022-04-17 編程語(yǔ)言

在這里插入圖片描述
只要你的元素沒(méi)有設(shè)置高度就可以 實(shí)現(xiàn)。可以用來(lái)處理一些響應(yīng)式的頁(yè)面處理

DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Documenttitle>
    <style>
        div {
            position: absolute;
            top: 50px;
            bottom: 150px;
            left: 50px;
            right: 50px;
            border: 1px solid #f00;
        }
    style>
head>
<body>
    <div>div>
body>
html>

關(guān)注我 持續(xù)更新前端知識(shí)

原文鏈接:https://yunchong.blog.csdn.net/article/details/122543840

欄目分類(lèi)
最近更新