Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 22, 2012 02:40 AM by teguhyuliantos
Contributor
5132 Points
1465 Posts
May 21, 2012 12:04 PM|LINK
Hi,
I have seen lot of sample from internet so that don't.
I need the best one and not deprecate.
<div class="main">
<div class="center">center</div>
</div>
3026 Points
564 Posts
May 21, 2012 12:10 PM|LINK
hi ,
you can use <center> </center> tag , to display in center of page..
Star
12345 Points
1856 Posts
May 21, 2012 12:12 PM|LINK
In standard way:
For Horizontal Align:
.main {
width:100%;
text-align:center;
}
.center{
margin:0 auto;
For vertical align:
.main { display:table; height:350px; } .center{ display:table-cell; vertical-align:middle; }
Check following good Link with Pros and cons:
http://blog.themeforest.net/tutorials/vertical-centering-with-css/
Member
37 Points
42 Posts
May 21, 2012 12:13 PM|LINK
you can use align tag in div class like
.main
{
align:"center";
May 21, 2012 12:17 PM|LINK
sujithkumar sujithkumar
do you know the center tag is deprecated and not support in HTML5? 555+
May 21, 2012 12:20 PM|LINK
I could did those but I just need your idea. See the pic.
Here is the code.
<div class="gradient"><span>New Thailand</span></div>
What I need is vertical-align: middle;
May 21, 2012 12:25 PM|LINK
urenjoy urenjoy
urenjoy .center{ display:table-cell; vertical-align:middle; }
It is bad version and I dislike.
Participant
1370 Points
372 Posts
May 22, 2012 02:40 AM|LINK
You can use this code to modify :
<div class="center">; tags </div>main</div>
thaicarrot
Contributor
5132 Points
1465 Posts
How to align element vertical to center?
May 21, 2012 12:04 PM|LINK
Hi,
I have seen lot of sample from internet so that don't.
I need the best one and not deprecate.
<div class="main">
<div class="center">center</div>
</div>
Weera
sujithkumar
Contributor
3026 Points
564 Posts
Re: How to align element vertical to center?
May 21, 2012 12:10 PM|LINK
hi ,
you can use <center> </center> tag , to display in center of page..
urenjoy
Star
12345 Points
1856 Posts
Re: How to align element vertical to center?
May 21, 2012 12:12 PM|LINK
In standard way:
For Horizontal Align:
.main {
width:100%;
text-align:center;
}
.center{
margin:0 auto;
}
For vertical align:
.main {
display:table;
height:350px;
}
.center{
display:table-cell;
vertical-align:middle;
}
Check following good Link with Pros and cons:
http://blog.themeforest.net/tutorials/vertical-centering-with-css/
rajesh134
Member
37 Points
42 Posts
Re: How to align element vertical to center?
May 21, 2012 12:13 PM|LINK
you can use align tag in div class like
.main
{
align:"center";
}
thaicarrot
Contributor
5132 Points
1465 Posts
Re: How to align element vertical to center?
May 21, 2012 12:17 PM|LINK
do you know the center tag is deprecated and not support in HTML5? 555+
Weera
thaicarrot
Contributor
5132 Points
1465 Posts
Re: How to align element vertical to center?
May 21, 2012 12:20 PM|LINK
I could did those but I just need your idea. See the pic.
Here is the code.
<div class="gradient"><span>New Thailand</span></div>
What I need is vertical-align: middle;
Weera
thaicarrot
Contributor
5132 Points
1465 Posts
Re: How to align element vertical to center?
May 21, 2012 12:25 PM|LINK
It is bad version and I dislike.
Weera
teguhyuliant...
Participant
1370 Points
372 Posts
Re: How to align element vertical to center?
May 22, 2012 02:40 AM|LINK
Hi,
You can use this code to modify :
<div class="center">; tags </div>main</div>
<div class="center">center</div>
</div>