Help with Alignment

Questions and tutorials related to Cascading Style Sheets *all versions*

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 13
Joined: Fri Dec 13, 2013 3:57 am

Tue Jan 07, 2014 10:38 pm

Yes I too having similar kind of problem in my site. So for that I fixed it with the table <tr><td> tags. But I want to do it without using it. Help us out with it.
User avatar
php-forum Fan User
php-forum Fan User
Posts: 65
Joined: Mon Jun 13, 2011 9:25 pm
Location: Pasig City, Philippines

Mon Jun 09, 2014 9:14 pm


You can add padding in your #Container. The padding will clear an area around your #Container. You can specify the padding of your top, bottom, left and right sides individually:

Code: Select all

padding-top: 100px;
padding-bottom: 100px;
padding-right: 50px;
padding-left: 50px;

Code: Select all

padding: 100px 50px 100px 50px;
which specifies the padding of top, right, bottom, and left respectively.

You can also search other ways on how to specify your padding.
I hope this helps. Thank you.
php-forum Fan User
php-forum Fan User
Posts: 73
Joined: Wed Jun 12, 2013 9:30 pm

Fri Apr 08, 2016 4:31 am


Try this:
<div style="text-align:center;">
<div style="border:1px solid #000; display:inline-block;">Div 1</div>
<div style="border:1px solid red; display:inline-block;">Div 2</div>
Post Reply