grid-layout

CSS grid layout changing column width with javascript

随声附和 提交于 2020-01-03 03:23:38
问题 I try setting up a CSS grid layout as follows .wrapper { width: 800px; display: grid; grid-template-columns: repeat(3, 200px); grid-template-rows: repeat(5, 200px); } Is it possible to locate grid-template-columns in JS then re-size the columns? I came across a situation where I could find it (lost the code) but when I tried changing it, Chrome DevTools say the value is computed and cannot be changed. Any help pointing me in the right direction (or other ways to do it, but use of grid is a

Fill grid container so that last grid item area is always filled

筅森魡賤 提交于 2020-01-01 17:17:13
问题 Right now I have a grid with 1 row and 5 columns , which I'm going to be using for navigational links, but there's a chance that on some pages the grid container might not have 5 children. The issue is that grids begin filling from the first available area. Is there any way to fill the grid container with grid items so that instead the last area is always filled? For example... [a][b][c][d][ ] should be [ ][a][b][c][d] [a][b][c][ ][ ] should be [ ][ ][a][b][c] Notably, I do not want to

Fill grid container so that last grid item area is always filled

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-01 17:17:11
问题 Right now I have a grid with 1 row and 5 columns , which I'm going to be using for navigational links, but there's a chance that on some pages the grid container might not have 5 children. The issue is that grids begin filling from the first available area. Is there any way to fill the grid container with grid items so that instead the last area is always filled? For example... [a][b][c][d][ ] should be [ ][a][b][c][d] [a][b][c][ ][ ] should be [ ][ ][a][b][c] Notably, I do not want to

Bootstrap 3 and .col-xs-* — Do you not need rows of 12 units?

橙三吉。 提交于 2020-01-01 04:49:09
问题 I'm a little confused by the Bootstrap 3 documentation and thus usage of the .col-xs-* classes. The docs for Grid Options say that all of the grid systems use 12 columns. If you take a look at Bootstrap 3's docs for an Example Mobile and Desktop layout they show the first row's .col-xs-* classes totaling 18 column units. What gives? How can this be? Are the docs wrong? Thank you 回答1: Bootstrap is a 12 column rid, but you can put more than 12 columns in a row. The remaining columns will simply

high resolution devices display extra small bootstrap layout

筅森魡賤 提交于 2019-12-31 05:32:07
问题 According to browserstack these are the specs for say Samsung Galaxy S7: Screen Size 5.1 in - 2.5 x 4.4 in Resolution 1440 x 2560 px Viewport 360 x 640 dp On this device my page displays in the extra small bootstrap layout or default layout because (I think) the device reports a viewport of 360px. But due to the high resolution I'd rather prefer it to load the tablet layout as 1440 / 1.5 -> 960 . I was under the impression bootstrap does this by default. Is something faulty in my

GridLayout with view dynamic get row/column

怎甘沉沦 提交于 2019-12-31 04:30:28
问题 I just followed this tutorial, to create a custom View as an item of a GridLayout . That's my CustomView public class RowView extends View{ boolean touchOn; boolean mDownTouch = false; private OnToggledListener toggledListener; int _IdRow = 0; int _IdColumn = 0; public RowView(Context context, int Rows, int Columns) { super(context); this._IdRow = Rows; this._IdColumn = Columns; init(); } public RowView(Context context) { super(context); init(); } public RowView(Context context, AttributeSet

Limit row's height on both “Auto” and “1*” in WPF

我的未来我决定 提交于 2019-12-31 03:04:12
问题 I have a WPF application which layout consists of 3 rows in a top level Grid . I want the middle row to use up the space it needs (the maximum space it needs is limited but depends on the width of the window). The bottom row shall use up the remaining space. The tricky part is the top row. Its size can vary depending on a button which toggles the visibility of a large part of the content. I want it to use at most 50% of the height but not more than it really needs. The following XAML

Can you set a permanent size for a JPanel inside of a JFrame?

可紊 提交于 2019-12-31 02:24:28
问题 My current problem is that I have a JFrame with a 2x2 GridLayout. And inside one of the squares, I have a JPanel that is to display a grid. I am having a field day with the java swing library... take a look Image Java is automatically expanding each JLabel to fit the screen. I want it to just be those blue squares (water) and the black border and not that gray space. Is there a way I can just set the size of that JPanel permanently so that I don't have to go through changing the size of the

LESS class name string interpolation not working

感情迁移 提交于 2019-12-29 09:41:52
问题 I am currently translating my grid into LESS, but I can't seem to figure out string interpolation. Here's helper class that is supposed to generate all my columns: .createColumns (@colNumber+1) {} .createColumns (@index) when (@index < @colNumber) { (~".col@{index}") { width: @baseWidth * @index; } .createColumns (@index + 1); } .createColumns (01); Problem is, I get error that says something is wrong with this part (~".col@{index}") . Here's the error message: ParseError: Unrecognised input

LESS class name string interpolation not working

你说的曾经没有我的故事 提交于 2019-12-29 09:41:49
问题 I am currently translating my grid into LESS, but I can't seem to figure out string interpolation. Here's helper class that is supposed to generate all my columns: .createColumns (@colNumber+1) {} .createColumns (@index) when (@index < @colNumber) { (~".col@{index}") { width: @baseWidth * @index; } .createColumns (@index + 1); } .createColumns (01); Problem is, I get error that says something is wrong with this part (~".col@{index}") . Here's the error message: ParseError: Unrecognised input