与父父级相关的CSS宽度(以百分比为单位) [英] CSS width in Percent related to the grand parent

查看:650
本文介绍了与父父级相关的CSS宽度(以百分比为单位)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将百分比的宽度与父级关联?

How to relate width in percent to the grand parent?

推荐答案

您可以简单地将 li 到父 ul : ul

You could simply relate width of li s to the parent ul which in turn it relates to the grand parent div:

div{
    overflow: hidden;
    width: 100%;
}
ul{
    width: 1000%;
}
li{
    width: 3%;
}

这篇关于与父父级相关的CSS宽度(以百分比为单位)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆