Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
How to show the news like a gallery

 
Reply to topic    Forum Index » FAQ View previous topic
View next topic
How to show the news like a gallery
Author Message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2668
Location: Germany

Post How to show the news like a gallery Reply with quote
This tutorial shows you how to show your news like this:



# # # #



# # # #



# # # #



instead of each post below the previous:



#

#

#

#



Tutorial taken from here.



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:



Code:
<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:



Code:
<div class="container">

<div class="left">news</div>

</div>




Your container now has one float in it, this will be your first news element. The class "left" should contain "float: left;" somewhere in the css.



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:



Code:
.left {

float: left;

width: 25%; // or its best to use 24% sometimes!

}


Ok your code should now look like:



Code:
<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 because 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.





For 4 columns on 5 rows

You just need to put $number = "20"; in your cutenews include code!
Wed Aug 16, 2006 7:38 pm View user's profile Send private message
Guest








Please login to hide the ads.

Display posts from previous:    
Reply to topic    Forum Index » FAQ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.