[Grid Layout] Use the repeat function to efficiently write grid-template values
2017-03-28 20:15
417 查看
We can use the
Using repeat:
Can aslo add named grid line to it:
so that we can refer to those later.
repeat()function if we have repeating specifications for columns and rows. With the
minmax()function, we can define a size range for our grid items. Let’s see how to apply these properties, and how it affects the behaviour of our grid layout.
Using repeat:
grid-template-columns: repeat( 3, /*each row has 3 repeat items*/ minmax(10px, auto) minmax(20px, auto) minmax(40px, auto) minmax(80px, auto) );
Can aslo add named grid line to it:
so that we can refer to those later.
.container { display: grid; grid-gap: 10px; height: 100vh; grid-template-columns: [start] repeat( 3, /*each row has 3 repeat items*/ [col-xs-start] minmax(10px, auto) [col-xs-end col-sm-start] minmax(20px, auto) [col-sm-end col-md-start] minmax(40px, auto) [col-md-end col-lg-start] minmax(80px, auto) [col-lg-end] ) [end]; } .box:nth-of-type(26){ grid-column: col-sm-start / end; }
相关文章推荐
- [Grid Layout] Use the minmax function to specify dynamically-sized tracks
- Use the windows live writer to write blog
- Question 16: Which of the following methods can a developer use to override the default terminate() function in C++?
- Write a function to find the depth of a binary tree
- [MySQL] you *might* want to use the less safe log_bin_trust_function_creators variable
- Write a function to find the longest common prefix string amongst an array of strings.
- How can I force Python's file.write() to use the same newline format in Windows as in Linux (“\r\n”
- Data Structure Linked List: Write a function to get the intersection point of two Linked Lists.
- you *might* want to use the less safe log_bin_trust_function_creators variable
- The log use to debug the function of ChangeTemplate
- [Grid Layout] Use auto-fill and auto-fit if the number of repeated grid tracks is not to be def
- How to use the pointer of function in a class?
- [Drupal] How to use the dsm function.
- How to properly use 'dd' to benchmark the write speed of your disk?
- how to use the MySQL subquery to write complex queries
- Given an array nums, write a function to move all 0's to the end of it while maintaining the relativ
- Write a function to find the depth of a binary tree
- you *might* want to use the less safe log_bin_trust_function_creators variable
- You are *required* to use the date.timezone setting or the date_default_timezone_set() function.
- [每日练习] write a function to find the key in a m*n matrix, where each line and column is incremental