Add space between each news entry

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
User avatar
duplay
Power Poster
Power Poster
Posts: 289
Joined: Tue Mar 14, 2006 1:57 pm

Add space between each news entry

Post by duplay »

I would like to have a space automatically added between each NEWS entries that are placed on my site (see screenshot) Currently no space is set to separate entries. below is news code:


{foreach from=$items item=entry}



{$entry->titlelink}




{if $entry->formatpostdate}

{$entry->formatpostdate}

{/if}

{if $entry->author}



{/if}

{if $entry->summary}

{eval var=$entry->summary}



{else if $entry->content}


{eval var=$entry->content}

{/if}


{/foreach}


[gelöscht durch Administrator]
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Add space between each news entry

Post by RonnyK »

DJM,

I call the logic with the same containers as for the Guestbook

Code: Select all

<div class="cms-guestbook-entry">
<div class="cms-guestbook-entry-header"><span class="cms-guestbook-entry-sendername">Laatste Nieuws</span> </div>
<p>{news category="general" number=5 detailpage="nieuws" dateformat="%d-%m-%Y"}</p>
</div>
The 3 used CSS-entries:

Code: Select all

/* Style each entry */
.cms-guestbook-entry
{
	border: 2px solid #000080; /*RK: was 1px en #069*/
	margin-bottom: 0.2em;
             background: #ffffff;  /*RK: was 99B3E5*/
             padding: 0 1em;  /*RK: added line*/
}

/* Style the message header */
.cms-guestbook-entry-header
{
	background: #000080;
	color: white;
	border: 1px solid black;
	margin: 2px;
             TEXT-ALIGN: center;    /*RK: added line to center header*/
}
/* Style the sender name */
.cms-guestbook-entry-sendername
{
   font-size: 1.2em;
   font-weight: bold;
}

You can see how this looks at www.terspille.nl where I have embedded the news on the home-page.

Ronny
User avatar
duplay
Power Poster
Power Poster
Posts: 289
Joined: Tue Mar 14, 2006 1:57 pm

Re: Add space between each news entry

Post by duplay »

Nice site, but I have done this before, but cant remember. I need to just add a "space" in the code I included above. Any ideas?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Add space between each news entry

Post by Dr.CSS »

You could add
before {/foreach} in the code or .NewsSummary {margin-bottom: 5px} to the CSS...
Post Reply

Return to “Layout and Design (CSS & HTML)”