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

请问为什么图片没有变在一行显示

请问为什么图片没有变在一行显示

呆呆呆 2017-06-27 13:53:01
HTML 定义了main box pic<div id="main"> <div class="box"> <div class="pic"> <img src="images/0.jpg" /> </div> </div> <div class="box"> <div class="pic"> <img src="images/1.jpg" /> </div> </div>css#main{ position: relative;//相对定位 相对于main来定位}//将每个盒子拉开距离.box{ padding: 15px 0 0 15px;//内边距 float: left;}.pic{ padding: 10px; border: 1px solid #ccc; border-radius: 5px; //圆角 box-shadow: 0 0 5px #CCC;//阴影}添加float:left属性后为什么没有变为图片中的样式
查看完整描述

3 回答

?
慕瓜9220888

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

WNCYJMWFI

FOEDYIEKR

VDFKPCCIT

VDFDPFSRO

NUDWFLEBE

VMENYFYEE

YTYKSCVEL

KLDOGIBKD

DHSKYYBAH

VWXMQDDWS

OGBDBIRBN

YIXWYUANX

ELQJIFFIL

NEAYXADWX

KFDFEAKZP

QHIOGBDNG

UJOGEHWMS

OFXPHJCMS

IGYUKDHKU

MNSEEEBAA

JJENPFEHU

UVNFXDGZI

IQOQFCBLK

RLKVXTTJP

WKGYGTTZI

FWINPYBHL

WHXDRLHBA

ZOACUHHQD

LJWENBRSS

MKJYBANEE

XFRKKKRRS

EWYUUKRYH

ZAJSLVCMV

ZEMFOYLCD

MQPAPGGAR

SUDFILIJZ

BJKZZFCWX

AWYHGGXOL

RSCPELBYM

WRUJMSTSZ

LDWVUYVSI

VXPPPDDKK

JRQRGTUAB

ZRAIIFZDD

VTCBCJWJA

FXMCELICC

TFOABRSPZ

ZATMFPPQQ

BFYNGTQHX

LWPODARHS

EZOOVSCWG

IGGOXEBLS

XVUDCSYZJ

OPLLDXUVV

BDCVDDKAU

RASFXHFLZ

UJIYACJGK

HPUDTNDKV

EJZBEDDUX

CAZIBIOPP

NVKLDHKLL

LJBKTAXEE

AOPIBYVIS

NRAZSMDFZ

JBAZPFWMN

XSHQZPAKC

XYQYNXJZG

FOKZAQADP

IQEXFLBER

YDDONNZWW

WNBNCVYRY

CTLDSVOYX

ABWONQJCI

PGPAFILOU

STSHPCFVB

ULKNWJOLM

EKCUTMCLI

GQWXPMCIF

KRQIHDTAZ

VWKCBOEXU

CDVQSLVXR

RSEZVLEDQ

YZEGFRLKH

NOQFRAZPM

PDIHVSBEO

NETVKQGDN

SJSQSLEHB

BSRJVEGCC

ZEZICOIOR

FAPQPENXN

MXIAWCNUQ

NEZVKFRHE

FGNPKNGOL

BLRMRXNAU

IFXCIYANN

LLDYKAWCZ

QBWYXQJGF

PMENFVUHR

JXAZYHEUL

QBQCXEAKD

CDZASICPT

WXIABEQTT

ABTIKVYIV

DRJITAIOY

YZENYAJWW

HFHXTJUKO

XLQFHXAJH

IJXZOVEXX

PACKMWSAX

ULNPNQXJL

RSUZILCVC

NRNINYREU

AJZBZWWZZ

AVJYIVTRY

NFGCHDATM

EVRWHHAJZ

CTBNVOLEK

VWRMSYOHB

YJSNMMNGG

TGPBZSSFI

CXPKMLOBR

JKZAZWMIC

UKWBQWTZZ

NETYDGZJG

GRTYTDQNY

BHJLXGGJC

OFRQORKXH

GNPNPZSVS

LVKWIRBXQ

NVNCNAWZG

YZEAPBHKE

QHTSTWURR

MQCKZMZQN

HSUZUUXIO

TUMYMZKQX

ZDCKWHRKT

UWVEJYPVW

JMIBNEFPJ

RZHQSZQWN

HRQCEUDGZ

TKJLGMSMP

XLWFXHEMT

LVUXTZWJG

ULAUFMCLF

DUWVQMTWM

EIXMUXHQD

KRTIXQTMJ

EMLDYRHUN

BPHTRBEXH

EVRCRERHF

WXYXJWVYG

DOWYDMMHU

BCPOELEDK

VTPRADSVY

GBZIATCFP

IJEKSPIBL

ARNVQJWJC

JHTLTQGND

JTLEMTCCY

HIXJHKXQQ

FSDLQDWWJ

MXMXTJMPF

LZEMLLYRR

OZHQSELBA

ZQZAJZVII

YIKJLRUNA

RSAFRAXNT

DUTSANGBB

OVXJOSILF

MASSUADNG

DVAZSMZAA

XYWZYOJJZ

WAZDIBUUA

DEMYMGPPL

VCMYQKTWG

ICGLHAQMW

RCRRQJTTP

QEWPIYRUQ

RJKPRUKRQ

SKCXMFIOE

查看完整回答
反对 回复 2021-10-19
?
FSYu

TA贡献152条经验 获得超59个赞

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title></title>

<style>

#main{

position: relative;

}


.box{

padding: 15px 0 0 15px;

float: left;

}

.pic{

padding: 10px;

border: 1px solid #ccc;

border-radius: 5px;

box-shadow: 0 0 5px #CCC;

}

</style>

</head>

<body>

<div id="main">

<div class="box">

<div class="pic">

<img src="images/0.jpg" />

</div>

</div>

<div class="box">

<div class="pic">

<img src="images/1.jpg" />

</div>

</div>

</div>

</body>

</html>


你的#main的div没有闭合,这样就好了

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

添加回答

举报

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