Overlap 3 images and center them in fluid container - css

I need to overlap 3 images and center them within a twitter bootstrap row-fluid div. Here is an example of what it should look like:
The solution can use javascript but I'd prefer if it didn't. Also, when the browser is resized the images should remain in the center of Div 1. Anyone have any idea how to do this?

Overlaping:
http://css-tricks.com/almanac/properties/z/z-index/
To center them, use margin-left and margin-right:auto, as long as the parent has a fixed width.

Related

2 responsive background images, one div inside the other

I have the following div with a background image and another div with a background image. They need to stay together in the same configuration when responsive. I have an auto scroll on hover the inside image. All done with CSS. However, I'm using padding to align the 2 together but it is making both images to small and I want them to fill the column. Does anyone have a better suggestion as to how to do this? Please take a look at what I did.
https://jsfiddle.net/517Design/gukbnzf8/3/

How to center a div around another element?

I'm trying to edit a tumblr theme to make my posts centered inside of an image (the image is in a div) I've tried giving the posts and div the same margin in CSS but I can't seem to get the image inside the div to center correctly on the page. I want the posts to be perfectly centered horizontally inside the image even when the browser window is resized. Anybody know how i can do this? Is there an easier way than having the image in a div? here is a link to my code
http://pastebin.com/x6MP6EYQ
First of all i would recommend using image as a background image. Would be easy to handle it as it will not affect other things inside a div.
Second, if you were to use image you would position it absolutely which mean main div should be positioned relatively. Then once image has been positioned i.e. top:0; left:0; put z-index:-100; so that way it will be always behind.
To make div always be centered both horizontally, vertically and in both directions. See my example. Here:
http://jsfiddle.net/techsin/TfLTR/
try style=aligen:center;
just you can manage by style sheet tag like padding and margin also .

div sync height to its peer on right

I have a container div with three child divs. see attached.
the center div can dynamically stretch in height. what I want is if the container div would stretch with the center div, then the left div will stretch to fit the new container div, and therefore stay in sync with the center div.
any one knows a pure css way to do this?
This doesn't actually adjust the height of the column, but the only non-javascript way to achieve this effect without actual content pushing the height down is using faux columns. You apply a background image to the parent element that mimics the column. Doesn't apply as well to responsive design, but the good folks at A List Apart do a better job of explaining the method here http://www.alistapart.com/articles/fauxcolumns/
yes that makes sense if you have a bottom-border. Let us know if you need help with the javascript. There will be no pure CSS way to accomplish this though. You have to find the height of the center div with javascript, and tell your left div to be the same height.

how to use css to float the div from bottom left to top right when reduce the windows screen size

I would like to know if I can float the div like this using CSS. What I would like to do is to move the DIV which is CSS DIV 2 under the CSS DIV 1 to the right when reducing the windows size. See the screenshot below:
This is how three DIV would display on bigger windows size. First DIV is at the top left corner, the second DIV is under the first DIV. Then the third DIV is on the top right.
When I resize the browser windows, the third DIV which has wider width will drop to the botton under the first DIV, and the second DIV will automatcially move to the top right corner to fill in the space.
Anyone think that this is possible to do it by using CSS, and might not need to use JS or others?
Thanks
I'd say that change is achieved either by changing from a columnar layout to a row layout, or else by swapping the order of the two elements. Either way, it requires JavaScript.

side-by-side divs not working in FF

Ok, I have finally got my divs to sit nicely side-by-side in a parent div.
But....I can not seem to put a margin between them. Sample of code is here. The two ids/divs in question are importInfo and newDevelopment. Both are absolute positioned with tops at 0 and left/right at 0 (respectively), widths at 50%. These two divs need to be fluid so that they extend vertically when the user adjusts their browser window horizontally. I need someone to point out my dumb mistake.
That's because they're not positioned correctly. Margins, padding, and border are by default not included in the calculation of the box's width. This is how your box actually appears on the page:
You really shouldn't be using absolute positioning for something as simple as this. Try setting both of the boxes as display: table-cell instead or find another more suitable solution to position the boxes next to each other.

Resources