This question already has answers here:
Box-shadow trimmed in CSS columns in Chrome
(11 answers)
Closed 7 years ago.
I am using CSS Column count to create a grid. However, I cannot fix a slight issue regarding the box shadow I am using.
It seems that the top row of each column has the top clipped off. This doesn't effect the border, but only box shadow.
heres a fiddle: http://jsfiddle.net/DTcHh/3947/
If you look closely you can see that the top row items have no shadow, and it looks like it has been clipped to the bottom of the column? Scroll to the bottom of the container and you will see the top part of the shadow there.
Any ideas how to fix?
Some back up css:
#builds {
width: 96%;
margin-top: 20px;
margin-bottom: 20px;
margin-left: 2%;
}
.cols {
-moz-column-count:3;
-webkit-column-count:3;
column-count: 3;
}
.item {
height: auto;
width: 99%;
margin-left: 1%;
-webkit-column-break-inside: avoid;
-o-column-break-inside: avoid;
-moz-column-break-inside: avoid;
break-inside: avoid;
border: 4px solid #000;
box-shadow: 0 1px 3px rgba(0, 0, 0, 1), 0 1px 2px rgba(0, 0, 0, 1);
margin-bottom: 20px;
}
<div id="builds" class="cols">
<div class="item">
<div class="thumbnail">
<img src="http://buildsanctuary.com/user_uploads/cover_images/Wenman,738.jpeg" />
</div>
</div>
</div>
Padding to the top of the columns container does not work. And if I give the items class a margin of 10, it works on the first element but not the others.
At first I thought I'm not seeing well since I wear glasses, But I think the problem is that you have two box-shadows with both y-offsets are positive. If you want to have a shadow on top of the element, the y-offset should be negative:
box-shadow: 0 -1px 3px rgba(0, 0, 0, 1), 0 1px 2px rgba(0, 0, 0, 1);
Is this what you expect: http://jsfiddle.net/pnrv7byy/2/ ?
I have been looking at this problem myself for quite some time before I noticed box-shadow was the source of inconsistent balancing in Webkit between same size boxes in my layout.
I believe the problem is this: Webkit (and Blink) have a bug with box-shadow and column where box-shadow affects layout calculation and messes up the column flow.
Currently it appears that Safari 9 and Blink 46 Versions (perhaps earlier versions) have fixed part of column flow issues in terms of the overall column heights calculation. However unlike IE, Edge and Firefox, Safari 9 and Chrome still count the box-shadow as an extra gap. And Chrome in particular cuts off the box-shadow, also apparently ignoring break-inside...
Here is my alternative to Nadeemmnn's solution:
http://jsfiddle.net/hexalys/DTcHh/14980/
The difference is I avoid an extra inside div wrapper for the box-shadow. Instead, I use a margin-bottom roughly equal to the box-shadow dimension +0.5px in this case. And I use margin-top for the top margin with inline-block(s) instead of blocks. Which is what i'd recommend inside columns.
It's hackish, but it seems to work ok for me so far.
PS: I'll go ahead and report those browser bugs if not already filed.
Here are my two solutions
Solution1:
HTML
<div id="builds" class="cols">
<div class="item">
<div class="thumbnail">
<img src="http://buildsanctuary.com/user_uploads/cover_images/Wenman,738.jpeg" />
</div>
</div>
<div class="item">
<div class="thumbnail">
<img src="http://buildsanctuary.com/user_uploads/cover_images/Bassboy,539.jpeg" />
</div>
</div>
<div class="item">
<div class="thumbnail">
<img src="http://buildsanctuary.com/user_uploads/cover_images/Chino,920.jpeg" />
</div>
</div>
<div class="item">
<div class="thumbnail">
<img src="http://buildsanctuary.com/user_uploads/cover_images/Wenman,738.jpeg" />
</div>
</div>
<div class="item">
<div class="thumbnail">
<img src="http://buildsanctuary.com/user_uploads/cover_images/Bassboy,539.jpeg" />
</div>
</div>
<div class="item">
<div class="thumbnail">
<img src="http://buildsanctuary.com/user_uploads/cover_images/Chino,920.jpeg" />
</div>
</div>
<div class="item">
<div class="thumbnail">
<img src="http://buildsanctuary.com/user_uploads/cover_images/Chino,920.jpeg" />
</div>
</div>
<div class="item">
<div class="thumbnail">
<img src="http://buildsanctuary.com/user_uploads/cover_images/Wenman,738.jpeg" />
</div>
</div>
<div class="item">
<div class="thumbnail">
<img src="http://buildsanctuary.com/user_uploads/cover_images/Wenman,738.jpeg" />
</div>
</div>
<div class="item">
<div class="thumbnail">
<img src="http://buildsanctuary.com/user_uploads/cover_images/Bassboy,539.jpeg" />
</div>
</div>
<div class="item">
<div class="thumbnail">
<img src="http://buildsanctuary.com/user_uploads/cover_images/Chino,920.jpeg" />
</div>
</div>
<div class="item">
<div class="thumbnail">
<img src="http://buildsanctuary.com/user_uploads/cover_images/Bassboy,539.jpeg" />
</div>
</div>
<div class="item">
<div class="thumbnail">
<img src="http://buildsanctuary.com/user_uploads/cover_images/Chino,920.jpeg" />
</div>
</div>
<div class="item">
<div class="thumbnail">
<img src="http://buildsanctuary.com/user_uploads/cover_images/Wenman,738.jpeg" />
</div>
</div>
<div class="item">
<div class="thumbnail">
<img src="http://buildsanctuary.com/user_uploads/cover_images/Chino,920.jpeg" />
</div>
</div>
</div>
Demo
here we have removed the box-shadow for item and added for thumbnail i.e from bootstrap
Solution2
Demo2
Related
I have 5 images and I want them to float left and stay on one line without images being moved to the next line, I also want a border right of 100% I have successfully done this with display: flex, however flex does't work properly in IE 11
Here is my HTML
<div class="col-md-12 award-logos">
<div class="wrapper">
<img src="https://www.hsjaa.com/images/joomlart/demo/default.jpg" />
</div>
<div class="wrapper">
<img src="https://www.hsjaa.com/images/joomlart/demo/default.jpg" />
</div>
<div class="wrapper">
<img src="https://www.hsjaa.com/images/joomlart/demo/default.jpg" />
</div>
<div class="wrapper">
<img src="https://www.hsjaa.com/images/joomlart/demo/default.jpg" />
</div>
<div class="wrapper">
<img src="https://www.hsjaa.com/images/joomlart/demo/default.jpg" />
</div>
</div>
And the CSS
.award-logos { border: 1px solid #ccc; }
.award-logos .wrapper {padding: 10px 30px;margin:5px 0;text-align:center;border-right:1px dotted #000; float: left;}
.wrapper img {max-height:150px; padding;}
https://jsfiddle.net/5sw538t7/
This question already has answers here:
Float 2 elements side by side inside a container div
(2 answers)
Closed 3 years ago.
I have loop that goes trough all pictures that I have and displays them. I would like to display them in one row, from left to right, but with css that I have is displaying them one under other. I have use flow but not sure if I used it correctly.
Here is my code:
.column.is-narrow {
float: right;
}
.box {
float: right;
}
<div class="column">
<div class="columns" ng-repeat="a in $ctrl.f">
<div class="column is-narrow">
<div class="box" style="width: 200px;">
<p class="title is-5">{{album}}</p>
<figure class="image is-128x128">
<!--<img ng-src="{{src}}"> remove and replaced for demo purpose-->
<img src="http://dummyimage.com/128x128" />
</figure>
<p class="subtitle">{{person}}</p>
</div>
</div>
</div>
I am aware that my css is not correct I have been searching for answer but couldn't find it.
Basically, when you float things, they'll still wrap if there isn't enough space to display both side by side. The easiest solution is to set a width on them to ensure that their container will always be wide enough to fit the content. You can do it with percentages or pixels, depending on your use case.
Note: If you use percentages, percentages adding up to 100% may still cause it to wrap, because they may not take into account padding, margin and/or border depending on other things. I usually do something like 49% for both, then float one right and one left.
You may use display and mind this inline-style <div class="box" style="width: 200px;"> wich is to start with, not wide enough to hold texts and img side by side
display:table/table-cell;
.column.is-narrow {
float: right;
}
.box {display:table;}
.box> p, .box> figure {display:table-cell;vertical-align:middle/* or top or else */
}
<div class="column">
<div class="columns" ng-repeat="a in $ctrl.f">
<div class="column is-narrow">
<div class="box" style="width: 200px;">
<p class="title is-5">{{album}}</p>
<figure class="image is-128x128">
<!--<img ng-src="{{src}}"> remove and replaced for demo purpose-->
<img src="http://dummyimage.com/128x128" />
</figure>
<p class="subtitle">{{person}}</p>
</div>
</div>
</div>
display:flex;
.column.is-narrow {
float: right;
}
.box {
display: flex;
/* removed width:200px from inline-style*/
}
p {
margin: auto;
}
<div class="column">
<div class="columns" ng-repeat="a in $ctrl.f">
<div class="column is-narrow">
<div class="box">
<p class="title is-5">{{album}}</p>
<figure class="image is-128x128">
<!--<img ng-src="{{src}}"> remove and replaced for demo purpose-->
<img src="http://dummyimage.com/128x128" />
</figure>
<p class="subtitle">{{person}}</p>
</div>
</div>
</div>
The easiest way is to declare the parent div as a flex container by setting the property display: flex and flex-direction:row. If you don't want to wrap your pictures, you can set flex-wrap:nowrap.
Here http://the-echoplex.net/flexyboxes/ is nice playground for flex box.
So I found the answer and it was pretty simple :)
I just had to add one more div with class with which I will float it to left. This is what I wanted:
.html
<div class="column">
<div class="columns">
<div class="float" ng-repeat="a in $ctrl.f"> /* added this line of code */
<div class="column is-narrow">
<div class="box" style="width: 200px;">
<p class="title is-5">{{album}}</p>
<figure class="image is-128x128">
<!--<img ng-src="{{src}}"> remove and replaced for demo purpose-->
<img src="http://dummyimage.com/128x128" />
</figure>
</div>
</div>
<p class="subtitle">{{person}}</p>
</div>
</div>
</div>
.css
.float{
float:left;
}
That was it. It's working. :)
I'm trying to move my horizontal row of images up a few pixels. How do I go about this? I'm a newbie.
This is my sample image. dont mind the mind blowing series of letters and numbers :) It is just a src code.
To move your images up a few pixels you should use the transform css style.
Its up to you if you want to set it in a class or id or directly in the img element as shown below. and set translateY([value]px) and your good to go..
Setting it to negative number of pixels will move the element or your image upward and otherwise if positive.
I hope it satisfies you. :)
Welcome to SO....
img
{
transform:translateY(-50px)
}
<img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMTEhUTExIVFRUWFRYYFhUWFhUVFhUVFRYXFhUVFRUYHSggGBolHRUXIjEhJSkrLi4uFx8zODMsNygtLisBCgoKDg0OGhAQGi0lHyUtLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIAMIBAwMBIgACEQEDEQH/xAAbAAACAwEBAQAAAAAAAAAAAAADBAACBQYBB//EADoQAAEDAgQDBgUDAwQCAwAAAAEAAhEDIQQSMUEFUWETInGBkaEGMrHB8BRC0VJi4QcjM3Ky8TRDov/EABkBAAMBAQEAAAAAAAAAAAAAAAECAwAEBf/EACcRAAICAgICAgEEAwAAAAAAAAABAhESIQMxE0EEUUIiMmHwFCOB/9oADAMBAAIRAxEAPwDnyEtVcmHmEnXcvIiXaI2oqVKyUfUQTVT42MnQ46qksTUVX1ko+pJRUDSmWLlGheAIrAnJDFMK6G0wo6okcbHTLEq9MpY1Fdj1NxGTHA5eOaqUyjMKk9DMDkVX000WoVQQimTYnkVaiM9BqK8QCtQJSq1dFw7gFasC5re60ElxsIAJJG5sNlgxLrX1v5Fd3GTkEwRhbVCrKxKdo8z9vt7rRwzlPnhYEaeWUnisPKeolWdTXLB4sqonPVMIVRtNb1TDpGthiF1rlsVxoWpU09SpoNJidYVKcgxQxQKeY+FmNqQruxC5Jq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Nl0IFSlOq3JFVoZoth3gXKJSdnBtqjCiIiBCHRMJlw4MyAVLQDdFc8EBDrs70oJaQkcX6N0CxVBo21QBY+SNi2F/kqEW6p4ykhGEwtLMeUpl2DaDI1CDw8kap8lNP7YySoAHOCHSquaTO6cJQayNqrRhetMzKrVDi2zlcyly46KcZNA6LMxFSNlFZptdRV/UC2bDNvNJHUqKK8eh2EoKtdRRLMDKO0RKOqiiSfYEFfqEduiiiEexhfFaFVweq9UVQex3FBKu2UUUZ/uCy7tEGjqV6oj7AXqpIfMoojIz7JikbDqKKT7CuyVVXEKKJX0YVzmBc6o4K9UQ/IUPsl6qiisg+ijEF26iiR9iM8YnKZsvFEWGJ44qtNRRH8QkcgnZRRaHQfQcBRRRMKf//Z" />
see if this works for you
.row img{
border: 1px solid #111;
box-shadow: 2px 5px 1px rgba(0,0,0,0.5);
}
.row1 img{
bottom: 8px;
position: relative;
}
.row2 img{
margin-bottom: 14px;
}
<div class="row row1">
<div class="col-md-12">
some text
</div>
<div class="col-md-12">
<img src="http://placehold.it/100x100">
<img src="http://placehold.it/100x100">
<img src="http://placehold.it/100x100">
<img src="http://placehold.it/100x100">
</div>
<div class="col-md-12">
some text
</div>
</div>
<hr/>
<div class="row row2">
<div class="col-md-12">
some text
</div>
<div class="col-md-12">
<img src="http://placehold.it/100x100">
<img src="http://placehold.it/100x100">
<img src="http://placehold.it/100x100">
<img src="http://placehold.it/100x100">
</div>
<div class="col-md-12">
some text
</div>
</div>
I am using older Skeleton css version, it is a 16 column grid system. I am trying to setup similar layout as in this picture.
http://imgur.com/sIV2aYo
I am pretty new to CSS, is using two containers (one inside another) a proper method?
Here is a sample code of what I been trying, but not working out too well =(
<div class="container">
<div class="eight columns alpha">
<div class="image">
<img alt="" src="images/coffee.jpg">
</div>
</div>
<div class="eight columns omega">
<div class="container">
<div class="eight columns">
<img alt="" src="images/plate.jpg">
</div>
<div class="eight columns">
<img alt="" src="images/macaro.jpg">
</div>
<div class="text area">
<p class="quote">"One of my favorite parts of using Square Register is being able to talk to customers while I am swiping their cards."</p>
<p class="name">Norm Mui, Coffee Foundry</p>
</div>
</div> <!-- 2nd container -->
</div>
</div> <!-- 1st container -->
Thanks in advance.
I don't know your CSS, but maybe this helps you:
HTML:
// The class "columns" is your "block" (div) that needs the content. I've made a CSS with a background-color, height and width.
// In that div "columns we create new "columns, numbered by 1,2 and 3. I've floated all the text to the left and gived it a margin. The first, second and the third a margin of 15px ( top, right, buttom and left ).
// In the div column "columns" I have made a textarea with also a margin of 15px. The vertical-align is for a top vertical align. with the display we means that it needs to be in the block, with a margin of 40% ( it takes 40% of the block).
<div id="container">
<div class="columns">
<div class="eight-columns-1">
<img alt="" src="http://ww1.prweb.com/prfiles/2014/04/10/11752526/gI_134971_best-image-web-hosting.png">
</div>
<div class="eight-columns-2">
<img alt="" src="http://www.causingeffect.com/images/made/images/example/cow_100_100_c1.jpg">
</div>
<div class="eight-columns-3">
<img alt="" src="http://www.causingeffect.com/images/made/images/example/cow_100_100_c1.jpg">
</div>
<div class="textarea">
<p class="quote">"One of my favorite parts of using Square Register is being able to talk to customers while I am swiping their cards."</p>
<p class="name">Norm Mui, Coffee Foundry</p>
</div>
</div>
</div>
CSS:
.columns {background-color:yellow; width: 530px; height: 285px;}
.eight-columns-1 {float:left; margin: 15px;}
.eight-columns-2 {float: left; margin: 15px;}
.eight-columns-3 {float:left; margin: 15px 15px 15px 0px;}
.textarea {vertical-align:top; margin: 15px; display:inline-block; width: 40%;}
I'm a visual designer, so this may seem a silly question (and at one point, this wasn't broken!) but I'm stuck. I'm trying to get images to appear in a responsive row with a mouseover.
Can anyone help? I know the code is jacked; I've been struggling with the order of the divs. The mouseover is working, BUT the images are now stacking and aren't appearing in a row anymore. They're outside of the col-lg-4 container, but I've included that. What am I missing?
*image is FPO
/// HTML:
<div class="col-lg-12">
<div class="highlight">
<h3>LOREM IMPSUM DOLAR</h3>
<h5>The fox and the rabbit.</h5>
</div>
</div>
<div class="row">
<div class="col-lg-4">
<figure class="cap-left">
<div class="thumbnail">
<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/eb/T_Roosevelt.jpg/473px-T_Roosevelt.jpg" alt="">
<figcaptions><h4>Please let this work</h4></figcaptions>
</div>
</figure>
</div>
</div>
<div class="col-lg-4">
<figure class="cap-left">
<div class="thumbnail">
<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/eb/T_Roosevelt.jpg/473px-T_Roosevelt.jpg" alt="">
<figcaptions><h4>Please let this work</h4></figcaptions>
</div>
</figure>
</div>
</div>
/// JSFiddle:
http://jsfiddle.net/zvcNa/
This is due to your padding: 30px 40px; for figcaptions{}.
figcaptions is 100% width and height, but add your padding to this size.
Remove this padding and add it to your figcaptions children :
figcaptions h4{
padding:30px;
}
FIDDLE
EDIT #1:
Replaced :
figure {
display: block;
position: relative;
}
.col-lg-4 {
display:block;
float:left;
}
FIDDLE