How to add custom layout and css in a CakePHP application?

Tags: php,html,css,cakephp,layout

Problem :

I'm about to begin developing a CakePHP application, I understand CakePHP is aimed at allowing developers to put a web application together as quickly as possible hence it comes with default CSS and layouts for the views.

How would I go about replacing this default layout and CSS? I read briefly about 'themes' but don't understand what they do exactly.

Appreciate the help.

Solution :

You can copy the default layout from cake/libs/view/layouts/default.ctp to app/views/layouts/default.ctp and edit the copied file. (Do not edit anything in the cake folder, only in app.)

Stylesheets are in app/webroot/css/. I would advise to leave the standard cake.generic.css alone and create a new file (or a copy of the generic file) to work with. You should link to the correct css file in your layout.

    CSS Howto..

    How to hide second row of a table using css?

    How do I remove the text underline (that I set myself) from a on hover?

    Best Practice (jQuery, CSS): How to initialize hidden elements that will toggle visible?

    How can I make the background of an HTML div black?

    How to render a template with dynamic CSS?

    How can I apply a CSS modification with a button [closed]

    How to Get CSS/JavaScript Pop-Up to Transition In

    How does max-width property make images responsive?

    How to remove an empty line between two navbars

    CSS 3D containers like shown in post

    Responsive Design - Toggle a Div's Visibility - how to integrate javascript with css @media

    How to iqnore mousemove event on child ul

    How to spin and rotate in css?

    How to change the width of displayed text nested in a div?

    How do you switch the cursor to a pointer cursor when hovering over the bars in a Kendo UI bar chart

    How to exclude inner webelement with css selectors?

    How to dynamically modify CSS class using Javascript / jQuery with wrapper?

    How to create fluid trapezoid image with css?

    How to select label for=“email” in CSS?

    How to parse CSS font shorthand format

    How to horizontally center align this absolutely positioned `` tag inside the relatively positioned div?

    How can add atribute to css of page on page load event

    How to sort and combine this css rules so it doesn't repeat so much?

    Button on ng-mouseover & ng-mouseleave won't get shown as expected - AngularJS

    How to make a CSS rule which applied on a div affect another div?

    How can the top DIV from two stacking DIVs affect the other's height

    How to override\edit Zurb Foundation base CSS styles?

    “ul li a:link, a:visited” and “ul li a, visited” how they different?

    How do I create a pattern overlay in CSS

    How can I align unsorted list horizontly ?