[SOLVED] CSS {display: table;} and <img>

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
User avatar
frankmanl
Power Poster
Power Poster
Posts: 425
Joined: Sat Jul 12, 2008 3:50 am

[SOLVED] CSS {display: table;} and <img>

Post by frankmanl »

I set up this 3 column design, using css property "display: table;".
I just found out that when the first content in the right column is an image, it pushes down the content in the left and center column:
http://www.thestoryconnection.nl/frank-test
Deleting the image, or putting something else above it "solves" the problem:
http://www.thestoryconnection.nl/frank-test2
Now, I don't know if it's the display: table property that causes this (a year ago there was a reason to use this property, but I can't recall why) or if it's something else. I searched for float and clear properties, but can't find anything that explains this behaviour.

How can I solve this? I prefer leaving my template as it is and just adjust some css, but when necessary I of course will adjust the template.

Frank
Last edited by frankmanl on Mon Mar 24, 2014 4:48 am, edited 1 time in total.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: CSS {display: table;} and <img>

Post by velden »

Don't ask why but:

Code: Select all

#linkerkolom, #rechterkolom {
    background-color: #ECF0F9;
    border-radius: 5px;
    display: table-cell;
    margin: 0;
    padding: 5px;
    vertical-align: top; // <-- this one seems to solve your issue
    width: 203px;
}
User avatar
frankmanl
Power Poster
Power Poster
Posts: 425
Joined: Sat Jul 12, 2008 3:50 am

Re: CSS {display: table;} and <img>

Post by frankmanl »

Great, thank you.
Post Reply

Return to “Layout and Design (CSS & HTML)”