How can I make the bottom margin of a div equal to its percentage-calculated right margin?


mckasty
HOME ยป Programming Languages

I have an array of floating divs that fit 4 to a row. Their widths and right margins add up to 100%. Their bottom margins, however, are static. CSS below:


.item {
position: relative;
float: left;
height: 200px;
width: 23%;
margin-right: 2%;
margin-bottom: 15px;
background-color: #ddd;
}

Is there a way to retrieve the value of the right margin and apply it to the bottom margin so they are always consistent?


Here is an example of what I have: http://jsfiddle.net/kVZMU/


Related to : How can I make the bottom margin of a div equal to its percentage-calculated right margin?
How can I make the bottom margin of a div equal to its percentage-calculated right margin?
Programming Languages

I have an array of floating divs that fit 4 to a row. Their widths and right margins add up to 100%. Their bottom margins, however, are static. CSS below:


.item {
position: relative;
float: left;
height: 200px;
width: 23%;
margin-right: 2%;
margin-bottom: 15px;
background-color: #ddd;
}

Is there a way to retrieve the value of the right margin and apply it to the bottom margin so they are always consistent?


Here is an example of what I have: http://jsfiddle.net/kVZMU/


white space appears top/bottom when I use h1 or div with margin-top or margin-bottom
7/1/2015 11:10 am Programming Languages

Could you please tell me why space appears when I put inside a div, another div/id/class/heading with margin top or bottom?

Here is the situation

Thank you!


swf at 100% width/height with a left margin of 400px and a bottom margin of 200px?
Programming Languages

Please can someone tell me if it is possible to have a swf at 100% width/height with a left margin of 400px and a bottom margin of 200px? Have managed the left margin using:
<div style="height:100%;margin-left:400px;"> <div id="flashcontent"></div> </div>
But cant get a margin at the bottom of the page, really could use some help.
Mike
margin-bottom not appearing in webkit when using jQuery Masonry and percentage values
Programming Languages

Hey I'm using the jquery masonry plugin with the basic settings.


For some reason jquery isn't displaying the margin-bottom i've specified in webkit browsers but is in firefox/gecko.


I've never experienced this before, any ideas?


update - I've realised its tied to the fact that I'm using a percentage to set margin_bottom. Is there a way to get around this




HD Wallpapers
3D
3D Abstract
City
Celebrities
Indian Celebrities
Cars
Travel
Girls
Animals Birds
Movies
Sports
Black White
Nature
Planes
Anime
Food Drink
Dreamy Fantasy
Architecture
Games
Space
Holidays
Flowers
Love
Artistic
Baby
Beach
Bikes Motorcycles
Macro
Computers
Vector
Funny
Army
Textures
Brands
Misc
Music
Other
Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .