Re: [css-d] Vertical & Horizontal Center ?

2015-06-03 Thread Chris Rockwell
When you declare "margin: 0 auto" you're explicitly giving instructions to not use margin on the top and bottom. If absolute positioning is acceptable, you can do: margin:auto; position: absolute; top: 0; bottom:0; left:0 right:0; On Jun 3, 2015 7:46 PM, "Crest Christopher" wrote: > I've come

Re: [css-d] Vertical & Horizontal Center ?

2015-06-03 Thread Georg
Den 04.06.2015 03:13, skrev Karl DeSaulniers: display:table and vertical-align:middle is one css way http://www.gunlaug.no/tos/moa_15a.html __ css-discuss [css-d@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinf

Re: [css-d] Vertical & Horizontal Center ?

2015-06-03 Thread Karl DeSaulniers
display:table and vertical-align:middle is one css way Best, Karl DeSaulniers Design Drumm http://designdrumm.com On Jun 3, 2015, at 8:00 PM, Erik Visser wrote: > Roger Blanton schreef op 04-06-15 om 02:26: >> Without knowing the height of the element or parent container I don'

Re: [css-d] Vertical & Horizontal Center ?

2015-06-03 Thread Ryan Reese
Display table/table-cell replicates the table counterparts. You certainly don't need to know a tables height to center it. It's no different in CSS...As my example shows. On Wed, Jun 3, 2015 at 9:04 PM, Ryan Reese wrote: > http://codepen.io/ryanreese09/pen/NqpMYa > > On Wed, Jun 3, 2015 at 9:02

Re: [css-d] Vertical & Horizontal Center ?

2015-06-03 Thread Ryan Reese
http://codepen.io/ryanreese09/pen/NqpMYa On Wed, Jun 3, 2015 at 9:02 PM, Roger Blanton wrote: > Because the table approach only works when you know the height of the > elements. Flex will work no matter what > > Hope that clarifies. > > — > Sent from Mailbox > >

Re: [css-d] Vertical & Horizontal Center ?

2015-06-03 Thread Roger Blanton
Because the table approach only works when you know the height of the elements. Flex will work no matter what Hope that clarifies.  — Sent from Mailbox On Wed, Jun 3, 2015 at 9:01 PM, Ryan Reese wrote: > I'm confused. You say if you can't use flex, you can't do it. Then you > acknowledge

Re: [css-d] Vertical & Horizontal Center ?

2015-06-03 Thread Ryan Reese
I'm confused. You say if you can't use flex, you can't do it. Then you acknowledge the table/table-cell approach exists. So why not use table/table-cell?! On Wed, Jun 3, 2015 at 9:00 PM, Erik Visser wrote: > Roger Blanton schreef op 04-06-15 om 02:26: > >> Without knowing the height of the eleme

Re: [css-d] Vertical & Horizontal Center ?

2015-06-03 Thread Erik Visser
Roger Blanton schreef op 04-06-15 om 02:26: Without knowing the height of the element or parent container I don't think it is possible without using a flex layout with just CSS. This is what i remember too. __ css-discuss [c

[css-d] review please - an existing site made mobile

2015-06-03 Thread Erik Visser
An existing site made mobile using the mobile last approach; http://www.utrechtsyogacentrum.nl http://www.utrechtsyogacentrum.nl/styles/ Mobile testing please. I have an adroid (4.2.2) phone myself. So tests from iphone and windows phone users are extra welcome! Thanks, Erik _

Re: [css-d] Vertical & Horizontal Center ?

2015-06-03 Thread Roger Blanton
Without knowing the height of the element or parent container I don't think it is possible without using a flex layout with just CSS.  If you know the height you can do top:50% margin-top: (negative half the height). Or you can make the parent display table its child display table cell and v

Re: [css-d] Vertical & Horizontal Center ?

2015-06-03 Thread Tom Livingston
#one { position:relative; background-color:blue; height:350px; width:350px; } .two { background-color:orange; height:125px; width:125px; position:relative; top: 50%; transform: translateY(-50%); margin: 0 auto; } On Wed, Jun 3, 2015 at 8:00 PM, Tom Livin

Re: [css-d] Vertical & Horizontal Center ?

2015-06-03 Thread Tom Livingston
It's: top:50%; transform: translateY(-50%) On Wed, Jun 3, 2015 at 7:46 PM, Crest Christopher wrote: > I've come across many pages how to center a item horizontally and > vertically, one method {margin: 0 auto;} works great, horizontally, not > vertically. I found another solution whereas, all I

[css-d] Vertical & Horizontal Center ?

2015-06-03 Thread Crest Christopher
I've come across many pages how to center a item horizontally and vertically, one method {margin: 0 auto;} works great, horizontally, not vertically. I found another solution whereas, all I do is add {top:50%;translateY(-50%);} to the child, that is not working either ? [Example