Bootstrap Grid Layout Tip [duplicate] - html

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Improve this question
I am trying to create a twitter grid, I have some grid spans that have a larger height then others and on each row of the grid the spans are pushed down. What I would like to do is have the items to appear under the over items. I have taken a screen shot of what it looks like and I have photoshopped how i would like it. Screenshots below.
Here is the original
Here is the photoshoped

There are 3 overall approaches to Bootstrap grid alignment / height issues..
A CSS only approach like this this..
http://bootply.com/85737
A 'clearfix' (responsive reset) approach like this this (requires iteration every x columns)..
http://bootply.com/89910
Finally you may want to use the Isotope/Masonry plugin. Here is a working example that uses Isotope + Bootstrap..
http://bootply.com/61482

This is a common issue as grid elements have to be in rows so first and last will loose left and right padding respectively.
Workaround I use:
- if there is a set number of grid elements per row then I don't include <div class='row'>, just the gridded elements, and then remove the extra padding with nth-child() property of every third and fourth element (in case there are three gridded elements)
Also you could try using masonry

Related

How to Make columns in row [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
Hi i want to know that how can we create column in a row with html and css.
Like this in the picture.1
You can try using one row like container, inside create 4 div's and add display flex and justify-content.
You could use Flex Box to have a single row of items and use the boxes to space appropriately, this will also provide scaling for different screen sizes.
Here is a link to a great explaination of what Flex Box can do: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
If that's not what you're looking for, there's always making a table.

Flexbox with Padding and Margins [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
Is it safe/acceptable when using flex containers to also use margin-top(bottom, left, right) and padding to shift a little space either, in between elements or to the left/right? Or is it better to use the flex-basis in combination with defined widths?
I think a better way to put your question is
Is margin & padding a "flex-way" to arrange elements inside a flex container? - Still doesn't make much sense but I guess the answer should explain why.
Answer
Flexbox(flexible box) is a layout concept & just provides a more efficient way to lay out & distribute space among its elements inside a flex container & gives you extra power to control your elements with unique properties like order, flex-grow, flex-shrink etc. - Very similar to what a grid layout does. Now you wouldn't ask a question like - "Can you use grid frameworks like Bootstrap along with margin/padding?" would you?
A simple answer to your question - Ofcourse you can, it all depends on your requirements. Its subjective not wrong/right to use them with flex. So yes, you definitely can use margin/padding in conjuncture with Flexbox and if your requirements demands it(which most of the time is the case) or you could just go complete "flex-way" using flex-basis(similar to width) etc. Sometimes when these won't suffice you will have to use padding/margin which again is very much safe/acceptable(I don't know what that means here though - however you take it).
Just need to understand that when you have defined a container as flex you cannot use few block properties like text-align etc.
Hope you got the right perspective.

Alignment in CSS [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
2 lines are displayed in the UI lyk . It's there in a single span element
I am testing this, and it looks good
however I am skeptic about it.
I want to align both the lines such that it looks like.
I am testing this, and it looks good
however I am skeptic about it.
both the lines start together unlike in the previous case.
How this can be achieved using CSS.
It's hard to say something without codes but I guess, you are looking for text-indent. I'm assuming your lines are in the same container and not separate lines, just a part of the same paragraph.
CSS text-indent property
Make sure that css codes affecting your text doesn't have text-indent property or set text-indent to 0px.
If it doesn`t work with "text-indent: 0;", than the solution is with JS/jQuery
Eg - remove extra white spaces using jQuery:
$('.pln').html($('.pln').html().replace(' ', '');

Div float positioning [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I feel like this is a very simple problem but I can't seem to wrap my head around it. What I have is a bunch of divs added to a container. Then I want those divs to freely position them self in any white space, but they must move from top to bottom, left to right. I also can not adjust the order of the divs. Here is an example of my problem http://jsfiddle.net/8GMGF/1/. I need the blue box to automatically move into the free space above it. Thanks for any input.
PS. I also tried flexboxes but they don't seem to be able to use free space either. Maybe I missed something.
The result you are looking for (with the subtle tweaks you want to make) might not be possible with pure html and css, you may wish to look into using a tiling plugin such as Masonary for jQuery:
http://masonry.desandro.com/index.html

CSS make div streamlined from all sides [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I need to make layout like on picture related, the difficult part is, in this big centered div rounded with another divs from all sides. Masonry plugin can make only cornered stamp divs, but not centered. So, how can I implement this?
I've just written a kind of extension for the Isotope plugin to enable stamps in random locations. It works quite well, but two stamps can still overlap (have to fix that ;)). Check out the code in this fiddle: http://jsfiddle.net/XS74t/
The way to use it: give your item the .stamp class and add the position as a html5 data element:
<li class="item" data-grid-pos='{"x": 2, "y": 1}'>
My stamped item
</li>
Please not that a lot of credits have to go to "Mikko Tikkanen, Zonear Ltd. ", beacuse it's a kind of an extension of his perfectMasonry plugin.
have fun!