grid-layout

Shrink grid items just like flex items in css

喜欢而已 提交于 2019-12-05 13:52:36
Is it possible to shrink grid items just like flex items in css? Grid items .container { display: grid; grid-gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } .child { display: flex; flex-flow: row wrap; align-items: center; justify-content: center; padding: 5px; border: 3px solid #a07; } <div class="container"> <div class="child"> text </div> <div class="child"> text </div> <div class="child"> text </div> <div class="child"> text </div> <div class="child"> text </div> </div> jsfiddle Flex items .container { display: flex; margin-left: -10px; flex-flow: row wrap; }

Gridlayout + ScrollView

霸气de小男生 提交于 2019-12-05 11:05:53
I want to create a layout like first page of android market. I am trying to use gridlayout as I would like to put imageview with different sizes and location, I also need to input scrollview. Actually my problem is how to input scrollview inside android.support.v7.widget.GridLayout? I´ve tried: <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res/com.astuetz.viewpager.extensions.example" android:id="@+id/scrollView1" android:layout_width="wrap_content" android:layout_height="wrap_content" >

Create a 4x4 responsive grid of squares with a margin of 20px on each side of the container?

孤街浪徒 提交于 2019-12-05 09:01:42
I want to create a grid of responsive 4x4 squares with a margin of exactly 20px on the left and right sides of the overall container. Furthermore, this would effectively eliminate the left margin on the first squares in each row and also eliminate the right margin on the last squares in each row since double margins aren't needed. The green color notes the 20px margins on each side. I've so far created the grid of squares with percentages but the problem is that, since I am applying a margin to all sides of each square, this method does not guarantee a left and right margin (on the container)

Grid layout with images

余生颓废 提交于 2019-12-05 05:29:06
问题 I'm trying to build this grid layout for images with HTML and CSS. I would like to use divs rather than table but I'm not sure what's the best way to go. Also I need to put a short description below each image. 回答1: I made up this simple responsive layout using floats and padding-bottom . The padding bottom is used to simulate the height of the elements. It can be a good start for you. If you want to go futher and learn more like for example add responsive images/text inside those squares, I

Flexbox, responsive grid of square divs maintaining aspect ratio

北战南征 提交于 2019-12-05 05:08:36
I'm trying to create a 2x2 grid with divs. Some of the divs might contain an image, but it will probably be set as a background, with the option background-size: cover . Here's the pen I created: http://codepen.io/qarlo/pen/vLEprq .container { display: flex; flex-wrap: wrap; justify-content: space-between; margin: auto; max-width: 960px; width: 80%; } .container__item { align-content: center; border: 1px solid #333; display: flex; flex-basis: 1; font-size: 3em; justify-content: center; height: 100%; margin-bottom: 1em; min-height: 300px; width: 47%; } <div class="container"> <div class=

How to place one widget over another in Qt

≯℡__Kan透↙ 提交于 2019-12-05 02:42:36
i have a window in Qt, on that i am drawing a picture. now i want to place the progressbar over it. how can i do that?.. steps i am following to do Create a window, Draw picture in paint event of window Then create QGridLayout layout, add your window Display over it. suppose i want to add progress bar, over a portion of picture window. how can i do that i dont think its possible to implement in window paint event. please assist me Thanks You can add the progress bar as child of your QWidget without adding it in the layout. This will draw the QProgressBar into the QWidget. Since you are not

Tkinter Grid Dynamic Layout

廉价感情. 提交于 2019-12-05 00:51:59
问题 I am wanting to create a grid layout, with a grid that fills the first row until it runs out of space in the window, and will dynamically move items to the row below (like text line-wrapping). As the window width is adjusted, the grid adjusts to fit. The boxes resizing is not desired. I intend to maintain each small box's size, but change where the layout puts each box. I imagine this functionality is possible by measuring the width of the frame, and if the (number of boxes)*(width of each

How can I make my columns different sizes using GridLayout in swing?

拥有回忆 提交于 2019-12-04 15:08:12
问题 I'm using a GridLayout and my code is as follows: int changingVar = 1; JPanel panel = new JPanel(new GridLayout(changingVar, 2)); panel.add(new JButton("BUTTON1")); panel.add(new JButton("BUTTON2")); This looks like: ___________________________________________ | [ BUTTON1 ] [ BUTTON2 ] | ___________________________________________ which is two evenly sized columns. I would like to make it like this: ___________________________________________ | [ BUTTON1 ] [ BUTTON2 ] | ______________________

CSS: display: grid and/or -ms-grid

谁说我不能喝 提交于 2019-12-04 07:50:22
问题 Is there a way to use both or either display: grid/-ms-grid into one style sheet or do I have to use an HTML hack or JavaScript to query what type of browser a page is being viewed with grid layout? Example: The following styling doesn't seem to work .container { display: grid -ms-grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(150px, 50px); grid-gap: 1vw; -ms-grid-columns: repeat(4, 1fr); -ms-grid-rows: repeat(150px, 50px); -ms-grid-gap: 1vw; } 回答1: Transforming new

Responsive Grid of Squares in Bootstrap

落花浮王杯 提交于 2019-12-04 07:24:04
I want to create a grid of responsive images that are always squared in Bootstrap. So far I got this: Jsfiddle Link This part forces the elements to be squared all the time: .frontpage_square { position:relative; overflow:hidden; padding-bottom:100%; } .frontpage_square img { position:absolute; } The bigger square on the left and the nine smaller ones on the right are correct, but I can't figure out how I can spread the nine squares on the right over the full height. So basically they should take the whole height of the left, bigger square. Coding Enthusiast It is simple, you aren't arranging