是否可以沿z轴堆叠元素而不使用position:absolute now?

时间:2016-06-30 16:36:39

标签: html css3 frontend

我知道这不是几年前,但现在可能吗?我们可以获得任何较新的css3属性,如flexbox,calc(),视口单元和z-index,以便一起工作并沿z轴生成一堆卡片吗?

Flexbox仅支持主轴和交叉轴,因此我不确定是否值得探索此路径。但是我希望能够做到:

#!/usr/bin/env perl use strict; use warnings; use Carp qw( croak ); use List::Util qw( sum ); use Path::Tiny; run(@ARGV); sub run { my @readers = map make_reader($_), @_; while (my @obs = grep defined, map $_->(), @readers) { print sum(@obs), "\n"; } return; } sub make_reader { my $fname = shift; my $fhandle = path( $fname )->openr; my $is_readable = 1; sub { return unless $is_readable; my $line = <$fhandle>; return $line if defined $line; close $fhandle or croak "Cannot close '$fname': $!"; $is_readable = 0; return; } } 堆叠在一起,如下所示:http://output.jsbin.com/nefufoy

divs

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>JS Bin</title> <style> </style> </head> <body> <div class="page red"> </div> <div class="page blue"> </div> <div class="page green"> </div> <div class="page yellow"> </div> </body> </html>

css

0 个答案:

没有答案