Topic: [FAQ] CuteNews Gallery
I'll do this article to help people, its going to be quite excessive so please try to follow me as best you can (even if your HTML/CSS is not very good, rely on common knowledge for this!):
CSS can work in divs, layers and floats.
Floats can be classes, classes can be set as specific widths.
So, your float must be left or right, pick one, preferrably left.
Your container can be a class (for XHTML validity).
You can style this "container" class in CSS, I recommend you do.
The first thing you need is your container. This will be your "Box" so you do:
<div class="container">text here</div>
Inside this container, you will be using the float: left; commands found in CSS, please look them up if you are not very familiar with how they work. Here is your first example:
<div class="container">
<php
$template="left";
include('show_news.php');
?>
</div>
You see i added a specific template here. Let's make that template called "left".
If you're done, put everything from the active news subtemplate part inside
<div class="left">
active news template code
</div>
Now for four columns you need to specify the width of each class inside the container. The class "left" will begin to look like this:
.left {
float: left;
width: 25%; // or its best to use 24% sometimes!
}
CSS is not added in the templates but in the file that contains the CN include code.
If you don't know how to add css to a file, google for it as there are different ways to do it and everyone has his own preference.
Ok your code as ouputed by the browser should now look like:
<div class="container">
<div class="left">news</div>
<div class="left">news</div>
<div class="left">news</div>
<div class="left">news</div>
</div>
See how there is 4 news and each one is beside another?... Now becuase you have specified a WIDTH in each of the class="left" above when you add a FIFTH news item, it will drop down BELOW the first, a SIXTH will be below the second, a SEVENTH will be below the third and so on so forth.
Hope thats KINDA helped you guys out
For 4 columns on 5 rows
You just need to put $number = "20"; in your cutenews include code!