[Additional divs in CakePHP]HTML elements horizontal and vertical alignment issue

20 Nov

In cakePHP, the form fields, buttons and links get messed up with a variation of few pixels and the alignment issue couldn’t get fixed through element inspection and additional divs are noticed in the view source of web page. Tried re-structuring, re-styling etc but the issue remains consistent. Then this post is for you. There is a two word fix for it simply add ‘div’=>false to avoid additional div wrapping around html elements.

e.g. <?php echo $this->Form->button(‘Submit’, array(‘type’ => ‘submit’,’class’=>’grey’,’div’=>false)); ?>

This additional div wrapping is an overhead, I felt so far, in a way to customized design. So make sure to add this ‘div’=>false, in your checklist of design debugging in cakephp. All the best with coding in cake :).

Leave a comment

Posted by on November 20, 2013 in cakephp


Tags: , , , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: