bwbrowning
bwbrowning

Reputation: 6530

Issues when trying to line up divs

I am trying to stack some long and shorter divs in a table-esque layout so that the div borders line up & create a grid.

Here is the basics of what I am doing on jsfiddle: http://jsfiddle.net/wFjXD/

I am having a couple issues:

1) Why is there a gap between my longer divs ?

2) If the gap goes away, the divs will be aligned, but if I zoom in or out on the page with ctrl + or ctrl - , the alignment will get off. How can I hardcode the long div to always have the same width of 5 smaller divs no matter the zoom level.

Thanks!

Upvotes: 0

Views: 40

Answers (1)

Rohit Azad Malik
Rohit Azad Malik

Reputation: 32202

Hi now give to font size 0 in parent and give another font size in your child

as like this

.cellcontainer {
font-size:0;
}
.longcell {
font-size:15px;
}

Demo

Upvotes: 1

Related Questions