Pills sticking together even when using margin - Tailwind - tailwind-css

I have these pills that look fine when I'm using full screen but if I minimize the screen they all stack together. I'm having trouble understanding why because I have margin on them. Is there something else you should use for pills to add margin?
Tailwind Playground Link: https://play.tailwindcss.com/DZQUeJAQBf?size=224x720

The problem with your solution is that if the text wraps into a newline there is no margin attached because it's kind of the same row but automatically wrapped.
You could use sth. like flex-box to arrange your pills in groups.
https://play.tailwindcss.com/9YtIfBxPRe?size=160x720

Related

Bootstrap - change table layout on mobile

So on desktop I want 4 columns with an image above the text like the first image (so col-3), very easy. (I have the image and text in the same col)
but on mobile I want the icon appear on the left and the text on the right as per the second image.
i have tried floating the image lleft and the text right but that doesnt work I tried splitting the image and the text but they won't line up properly on all screen sizes if i do.
This feels like it should be so easy but my brain is stuck.
You can try using Flex instead of floating divs for the div that contains col class
See here an example - https://playcode.io/995433 (Try to resize the playground viewport to see the mobile layout). I hope this is what you need. I've used BS inline classes for convenience.
Bootstrap align div horizontal to vertical on responsive There is your reference

Bootstrap layout: Img nested inside a div won't align left edges

I have a bootstrap container with an img inside. I'd expect the left side of the image to align
with the LHS of the container. Looking through the CSS with the browser debugger doesn't show any margin, border, etc that seems to be responsible. Playing with position and align doesn't fix this issue.
I can force it by styling the img with "margin-left:-15px".
I'd really like to know why this isn't working as I'd expect and where does the 15 pixel magic number come from.
Thanks,
Joe
#joe McGuckin. The magic number comes from the bootstrap template css file. Here is the snapshot from Bootstrap.min file.
Bootstrap is a frame work which provides some built in elements to make a page responsive. Please refer to the bootstrap documentation for guidance.

Flexbox parent is taller than its children

I've built a small layout using flex and chunks form Bootstrap as well as a mini grid system but I'm having issues with situations where the children of that flexbox are not tall enough to actually fill it. In my case, if you go ahead and inspect the .demo-install-components, you can see that it has a higher height than its children. Surprisingly, if I add just another item .install-component-individual to the mix, it's fixed or if I remove the check icon .installed-component-check. To me, this smells very, very bad. It looks like this:
Here's the code (sorry for it being so long and on jsfiddle, wanted to provide everything I have):
JSFiddle code.
What exactly am I missing here? I feel as if my knowledge of flexbox isn't complete.
Margin from #components-to-install-list ends up under your container.
By removing the width and margin from #components-to-install-list (line 986-987 from CSS), the space underneath will disappear:

Bootstrap wrong alignment of items

I'm new to bootstrap, I use col-md-* grid system to make a list of items. Each item is something like the picture below
The source code in JSFiddle.
The problem is when I decrease the size of the browser windows, the red rectangle goes in the wrong place. How can I fix it?
If you want something to be the right but not all the way to the right you should use the bootstrap grid off-sets.
Second
Take a look at this grid example and see what resizes at smaller windows to full-width.
also the the responsiveness of bootstrap at certain widths makes col-md-6 100%
it seems like you will need to col-xs-6 instead.
I have updated the fiddle here
http://jsfiddle.net/ZTgGX/2/

Custom post with div too much margin

i'm having a slight problem which i can't seem to figure out how to solve in a wordpress layout.
I have 3 columns which shows the recent posts with each one being an individual by itself, but as the div increases in height, it pushes the next line of div downwards, but what i wanted is just each div having a 20 px margin with each other.
here's a picture of what is happening
here's a picture of what i want
You might want to consider using Masonry to implement the layout you're trying to achieve.
HTML and CSS alone will not get you the effect that you are looking for. For the full effect, and a well put together tutorial, visit:
http://benholland.me/javascript/how-to-build-a-site-that-works-like-pinterest/

Resources