Macint0sh_Plus
Macint0sh_Plus

Reputation: 11

How to align a Div in a table cell- Not working for me

I have a table which I want to align some divs horizontally, but it doesn't seem to be working for me. I'm sure the solution in simple.. What I'm finding annoying is that the text-align feature is only aligning the textareas (which is perfectly normal) but I can't find a way to do the same with the divs.

What is weird though is that when I zoom in a lot it does align.

jsFiffle

Upvotes: 1

Views: 41

Answers (2)

GvM
GvM

Reputation: 1733

https://jsfiddle.net/9a2mc3vw/ ~ check this fiddle

  background-image: url('http://i.imgur.com/sn7XtQE.jpg');
  height: 51px;
  width: 51px;
  display: table-cell;

Upvotes: 1

Denny Sutedja
Denny Sutedja

Reputation: 538

this code will work if you delete display: inline-block in your div id

background-image: url('http://i.imgur.com/sn7XtQE.jpg');
height: 50px;
width: 50px;
margin: 0 auto;

Upvotes: 0

Related Questions