Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Something on left, something on right, fluid #154

Open
mhulse opened this issue Mar 31, 2018 · 0 comments
Open

Something on left, something on right, fluid #154

mhulse opened this issue Mar 31, 2018 · 0 comments

Comments

@mhulse
Copy link
Owner

mhulse commented Mar 31, 2018

/*
Best for photos with captions to right or left:
<div class="bunch bunch-[right|left]">
	<(any element)>
	<(any element)>
</div>
*/

.bunch { margin: 20px 0; }
.bunch::after {
	content: "";
	display: table;
	clear: both;
}
.bunch.bunch-left > :first-child {
	margin: 0 20px 0 0;
	float: left;
	display: inline;
}
.bunch.bunch-right > :first-child {
	margin: 0 0 0 20px;
	float: right;
	display: inline;
}
@media (min-width: 737px) {
	.bunch.bunch-left > :first-child { margin-right: 40px; }
	.bunch.bunch-right > :first-child { margin-left: 40px; }
}
.bunch > :last-child {
	margin: 0;
	overflow: auto;
}
.bunch > * > :first-child { margin-top: 0; }
.bunch > * > :last-child { margin-bottom: 0; }

… for a responsive version of the above, change the overflow on :last-child to visible and add a media query (at desired breakpoint) to handle the “columnization” of the elements:

.bunch > :last-child { overflow: visible; }
@media (min-width: 768px) {
	.bunch > :last-child { overflow: auto; }
}
@mhulse mhulse added the README label Mar 31, 2018
@mhulse mhulse added the Layout label May 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant