Professional CodeIgniter

(singke) #1

Chapter 3: A 10,000 - Foot View of CodeIgniter


71


Again, the goal at the moment is not to understand every single aspect of how views work. What you
want to do right now is create a general purpose Template view (made simple for this project because
each page lives in the same square outline) and the three dynamic includes that you can load as needed
with your controller.

This is also a good time to set up your initial CSS file (in the folder /css, which you created in Chapter 2
to hold your css) so that your views can reference it.

Setting Up a Simple CSS File


Create a file named default.css , and place it in the /css folder in your CodeIgniter root. Then place the
following CSS into that file:

/* default css */

body{
background-color:white;
font-family: Arial, Verdana, sans-serif;
margin:0;
padding:0;
}

#wrapper{
width:1000px;
margin:10px auto;
padding:10px;
background-color:#f1f1f1;
border:2px solid #ccc;
}

#nav{
float:left;
width:135px;
height:auto;
}

#main{
float:right;
margin-left:150px;
width:800px;
height:auto;

}

#header{
font-size:12px;
margin-bottom:10px;
}

#footer{
clear:both;
padding-top:40px;
font-size:9px;
}
Free download pdf