弹性盒子布局和多列


一、弹性盒子布局

 


<figure>


      <img src="img/01.png">


      <aside>美食</aside>


    </figure>


    figure{


      displayflex;


      flex-directioncolumn;


      align-itemscenter;


    }



二、悬挂式布局


<div class="food">


      <img src="../day17/images/mao.png">


      <figcaption>


      <div class="fig">


       <p>老诚一锅</p>


       <p>[5店通用]100元代金券一张,可叠加</p>


      </div>


       <div class="wrap">


         <p class="p"><span>118</span> <span></span> 门市价:100元</p>


        <span>已售192710</span>


      </div>


    </figcaption>


    </div>


.food{


      width100%;


      height100px;


      padding10px;


      displayflex;


      border-top:1px solid rebeccapurple;


    }


    figcaption{


      width100%;


      height100%;


      displayflex;


      flex-directioncolumn;


      justify-contentspace-between;


    }


    .fig p:nth-child(1){


      font-sizelarge;


    }


    .fig p:nth-child(2){


      font-sizesmall;


      colorrgb(737373);


    }


    .wrap{


      displayflex;


      justify-contentspace-between;


    }



三、多列


1、column-count:分栏的个数


2、column-width:分栏的宽度


3、column-gap:分栏的间距


4、column-rule:分栏的边框


5、column-span:all/none  设置或检索对象元素是否横跨所有列。


6、column-fill设置或检索对象所有列的高度是否统一(目前大部分浏览器尚未支持) auto:列高度自适应内容/    balance:所有列的高度以其中最高的一列统一(默认值)


7、break-inside:avoid避免中断【见瀑布流图片】


四、媒体查询


@media【and后面一定要有空格】 screen  and  (min-width:320px)  and (max-width:750px){


  body { background-color:blue;}


 }


screen 是媒体类型里的一种,CSS2.1定义了10种媒体类型【默认是all】


and 被称为关键字,其他关键字还包括 not(排除某种设备),only(限定某种设备)


(min-width: 400px) 就是媒体特性,其被放置在一对圆括号中。


引入样式格式 <link rel=“stylesheet” type=“text/css” media=“screen and  (orientation:portrait)”    href=style.css>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值