a quick note to „order“ your CakePHP Scaffolding add / edit Fields

26 03 2009

If you wonder why your edit and add function look so crappy by default, add in your css file a


div.input.text label, div.input.textarea label{
float: left;
width: 20%;
}

which just let the cake default view look a bit cleaner. This is no big thing, but i think everyone who uses cake will uses it. This is nothing special but its a common leak which most people forget caused of the small use of label (Using Label is extremly good for your code. It helps handicaped people to read your page and increase your usability (if you want to decorate the label for example) ).

And why a float object? Because „label“ is a inline html object. This means normal „width“ does not have any effect to it (until you let its float or change this by „display: block“).

Advertisements