Content Block Margins

Permalink
I couldn't find anywhere on here where this is already addressed, if so please tell me. Sometimes when I add the content block it has a top/bottom margin(space). Sometimes it does not. It seems to happen randomly. I don't have any spacing set to it whether margin or padding. Does anyone know what's going on and how to fix it? Am I unknowingly selecting some setting to get this result? Unfortunately, I can't give a link to it as I'm still developing on XAMMP.
Thanks for any help in advance. C5 Rocks!

pakigreenl
View Replies:
pakigreenl replied on at Permalink Reply
pakigreenl
Also, it sometimes happens with the expand/contract extension block as well.
pakigreenl replied on at Permalink Reply
pakigreenl
nevermind it was a css problem with the template.
rritz replied on at Permalink Reply
rritz
maybe you could tell me, how you solved the problem?

I have a problem about transparency. Some content blocks have a solid black background and some are transparent and I don´t know why.
jlev replied on at Permalink Reply
Hello everyone,

I'm sorry to resurrect a dead thread, but I'm having trouble with top- and bottom-padding of certain content blocks, too. I've looked through my CSS sheet in detail several times and can't find anything that should be causing it.

Specifically, content blocks that are rendered as <p></p> in the final page are being given top and bottom padding of approximately 1.5em by Concrete5 (i.e., not by my CSS sheet). Other blocks, such as image blocks, don't have this padding. Just to check, I deleted my entire CSS sheet and found that Concrete5 still rendered the p content blocks with top and bottom padding.

Does anyone know why this is? Is this a known feature of Concrete5, or is it a bug?

I would greatly appreciate any help or thoughts you might be willing to offer!

My best,
J.L.
tallacman replied on at Permalink Reply
tallacman
A url would help fix this problem.

steve
jlev replied on at Permalink Reply
Hi tallacman et al,

Sorry about that! I've set up an example page at
http://www.stressandhealthresearch.com/index.php/test-page/...
The page hasn't yet been optimized for older versions of IE, so viewing it in a non-IE browser would likely be best.

The CSS sheet is at
http://www.stressandhealthresearch.com/themes/whole-program_templat...

The PHP template for the page reads

<?php  $this->inc('elements/header.php'); ?> <!-- This inserts the header, starting with DOCTYPE and continuing through </head>. This is all drawn from an external file, which can be found and edited in the "elements" folder. This allows for easy edits of this code across page types, which all share the same code. -->
<body>
<div id="wrap"> <!-- This is per the instructions athttp://www.concrete5.org/documentation/developers/pages/themes.... It should keep the CSS from getting in the way of Concrete5's rendering of editing popups and/or toolbar. -->
      <?php  $this->inc('elements/IE_warning.php'); ?> <!-- This inserts any code you want at the top of the page, esp. the Internet Explorer 6 or below warning fromhttp://www.daobydesign.com/blog/tips/css-html/hate-internet-explore... This is all drawn from an external file, which can be found and edited in the "elements" folder. This allows for easy edits of this code across page types, which all share the same code. -->
<div class="content_box"> 
   <div class="header_box">
      <div id="logo">
         <?php
             $a = new Area('logo');
               $a->display($c);
         ?>
      <!-- The old version hard-coded the logo using something like: <img src="<?=$this->getThemePath()?>/../../program_logo.png" alt="Stress and Health Research Program" />  -->
      </div>
      <div id="searchbar">
         <?php


"Header.php," which is referenced in the above PHP, reads

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<!--This was converted from HTML to Concrete5 PHP using the instructions athttp://www.concrete5.org/documentation/how-tos/designers/make-a-the...
<?php
Loader::element('header_required'); ?>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
</style>
<link rel="stylesheet" type="text/css" href="<?=$this->getThemePath()?>/Program_Website_CSS_Main.css" />
<!--[if lte IE 7]> <link rel="stylesheet" type="text/css" href="<?=$this->getThemePath()?>/Program_Website_CSS_Internet_Explorer.css" /> <![endif]--> <!-- This is a conditional Internet Explorer Comment. If the user is browsing with less than or equal to IE 7, this second CSS sheet will be loaded. This allows us to re-define the website specifically for IE7 and lower, to accommodate it. This solution is fromhttp://msdn.microsoft.com/en-us/library/ms537512%28v=vs.85%29.aspx... -->
</head>


Again, I appreciate your help!

Thank you very much,
Jacob L.
tallacman replied on at Permalink Reply
tallacman
I replaced your css with just this:
*{
   border: 1px solid red;
}\


And the result is the image attached showing all your elements. The browser defaults are in effect so you have some padding and margins happening. You can zero that out with a reset css which will remove all browser formatting.

steve
tallacman replied on at Permalink Reply 1 Attachment
tallacman
opps, image attached.
tallacman replied on at Permalink Reply 2 Attachments
tallacman
here is your page before and after adding this aggressive reset:

/*
    Tripoli is a generic CSS standard for HTML rendering. 
    Copyright (C) 2007  David Hellsing
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
* {
jlev replied on at Permalink Reply
tallacman,

Wow! I had no idea about any of that, and very likely would not ever have figured that out. I very much appreciate your help! Thank you!

Gratefully,
Jacob