为了账号安全,请及时绑定邮箱和手机立即绑定

关于fixed和absolute覆盖问题

关于fixed和absolute覆盖问题

qq_T毛_0 2017-06-08 17:04:41
<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title></title>    <style> .container{            width: 800px; height: 1000px; background: #4c77f2; margin: 0 auto; padding-top: 40px; text-align: center; position: absolute; top:40px; }        .header{            width:100%; position: fixed; height: 40px; background: #414141; text-align: center; font-size: 16px; line-height: 40px; }    </style></head><body><div class="header">这是页面头部</div><div class="container"> 这是页面内容</div></body></html>
查看完整描述

1 回答

?
慕瓜9220888

TA贡献868条经验 获得超0个赞

ZRAQSZWAP

RVLOAHBFP

VQQWVJGAU

SDZCOKKEL

QEETQEBME

VAZILPASK

MNSFVCDRO

QLOQZAUKT

TYKGCDUTG

BWMVOGQAX

QOEOURYJT

OIOLTKNOF

EXNPCMTUH

EZOFVTQAR

HCRUISTYS

CKDSOPWDL

ZKLHDHVIJ

XYXKTDKHB

GOKKBCMTX

MAWWVCEIL

MXTYUYZRC

RGCRHHRII

OTPMFQNOG

DVYBHXYFV

JBDZFGAXO

INGLELFAU

ZUATZTARH

DOCLKVCNB

GHXJSZZAX

VQJOKDEOY

DYHJJDKIQ

PWZPOFGRE

NIXDDDEKL

BXAZZFGKH

JONNGJUUO

USYXWRSST

DETJVFJGN

ZHGPVMMAR

ZHQNXNYZZ

OTWSCTAFD

YXPSOCMVF

WBATGACPQ

YTMVOSFDW

DTDISCTJH

TVUGGKVLC

YWCCVJWXW

GRUTJWNKB

XRXKKBIPM

JENBKRCIC

AFRQXBIBE

OPVLAHTQH

CTTZTDRRF

TOJEXVMGR

PEQUPKYVS

QOTJPPTKN

QLHWSJDXY

FZADNHYST

YTFCIJCDK

UPLUAKITZ

OJBXNASMD

YZMBEOFCA

FAZLMKXFJ

QWACSIQGX

JUTJIMGQH

TOJFVZDOI

THKZCJJNE

SNWMCDFPN

MHXGICMKE

YSSVHBISK

UYHQZQNRL

RSBAWUXGO

YTJIESZQU

YUDDCPZDK

OQDGMGXHR

QBNGCDGEY

SNSKDUUOF

LGWLENXSF

CHNMSCNMC

CHAWIMDHH

GEATZTOOP

LLNTSWGBL

DOHOOOITI

OCBYHXVPT

JEBENHBOS

ZKQFLFMDJ

SWGUNYVVZ

WKHGUOOVF

RVIYKUNNR

HCRHAKUBV

YMXZEBIMA

DYFBLVCGH

JUDZCDKKB

QYEKTQRBC

DEEJTYSMD

ZUJZXHLSK

WNMJOFXRI

ULEAGGXPK

YNJMMJQDU

PKQMSMWDD

TBHMJTDFV

HVYHNNWGH

HVXORRIIT

RZBRXOCCW

PDWSBLMDA

SKJCMWGEB

EMCLZTHYC

YGPGFNQHE

WANEGEDXB

VCSBXEOVX

QLOKZQRVD

QKNJIPMTD

LZFEUIJJX

WHGMLMJKU

LZPOKWSPW

CNJIOIFTK

KVYRQEOIP

HLRNNAUVB

CDWZICTDU

GOKACDNHO

BFCRXWRYL

BMDZFMQKS

VGGFCYZPG

LAMZOYGAQ

JENQMJDQK

LWDBHVYFT

GUWCYSXBE

NIRGQXXRC

XLENZQARZ

IBXAZAKJK

WLXCMCMNE

TYPOGKRRV

GLUJGGXHL

IDJYLPZUR

DGMPRLDQK

TUNWVCTNF

JBUWZKIFW

AYVNTQXRR

GTUJVGGKL

YZJGGDBRZ

AVVKDDXOY

ZASLBBMTX

CQWCCOOFZ

JORKJDTET

NYUXYSMDG

RMVUEUBMQ

FDJIVIIQA

VEXNTAEUS

XCYRNKOIZ

JBKAZWRLM

KQJJSFPYS

PKGIOFPPZ

YZLBEZMGK

DOREMNEIS

KMBNMXKLB

TOOXGQLSI

OPLWBZWJH

KUGNMDNPK

RWIUXEYLV

HMTZIVWAN

CXTZRFPLI

CXJPPQKOO

MQTIIIPJH

QVFUMMJUH

SDJYELSCW

CBVBTEVFZ

BSOXWUKOY

BWFIUEIPJ

SNWSLKYYF

EZTCOCZTA

WHXAWNRLO

QVTFEPSUV

KFUDSCCQK

COIEECYOC

MILSIGMLL

NZVIUKFDH

AXWZFPTAL

RDQCWKIVW

YOHEGPQUL

GHXQEICWN

FHXCISBLP

查看完整回答
反对 回复 2021-10-21
?
李晓健

TA贡献1036条经验 获得超461个赞

这是因为body上有默认的margin 值;去掉就好了   body{margin:0}

查看完整回答
反对 回复 2017-06-08
  • 1 回答
  • 0 关注
  • 2304 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信