I have a white space appearing between the two div elements
col3-2 and the_content which I have been unable to resolve.
Visit site here
You can see the white gap between the image, and the green element.
HTML - PHP:
<div id="imageslider" class="clearfix">
<?php echo do_shortcode('[advps-slideshow optset="1"]'); ?>
</div>
<div class="col3-2">
<div id="content" class="clearfix">
<?php
$args = array( 'pagename' => 'home' );
$the_query = new WP_Query( $args );
while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div class="the_content">
<?php the_content(); ?>
<?php edit_post_link(__('Click to edit this content','themify'), '[', ']'); ?>
</div>
<?php endwhile; wp_reset_query();?>
</div>
</div>
CSS:
.col3-2
{
float: left;
margin-left: 0%;
}
.col3-2 {
width: 100%;
font-family: 'Titillium Web', sans-serif;
}
.col3-2 h1 {
margin-right: 20px;
font-size:300%;
}
.the_content{
display: none;
}
#content {
float: left;
padding: 0 0 0%;
width: 100%;
}
The problem lies in an extraneous <p> tag appearing in the div.the_content tag:
<div class="col3-2">
<div id="content" class="clearfix">
<div class="the_content">
<p></p>
...
It looks like you're pulling this in from somewhere else, so editing the code you posted probably won't help much. Simply remove the <p></p> from the source of the content.
As stated in a previous answer, the problem is due to the p element in the code snippet:
<div id="imageslider" class="clearfix">
...
</div>
<div class="col3-2">
<div id="content" class="clearfix">
<div class="the_content">
<p></p> <!-- this causes the problem... -->
<div id="section1">
<p></p>
...
Removing the p could solve the problem, but since the content can be edited in the future (Wordpress is the CMS in this case), then the p could reappear if the user editing the content inserts an extra carriage return or two in a WYSIWIG inline editing window.
The issue is due to collapsing margins between the p (and the containing blocks such as .the_content) and #imageslider.
A better fix would be to force the .the_content block to start a new block formatting context, which can be triggered by using:
.the_content {
overflow: auto;
background-color: #17C2A4;
}
If you specify the background color on .the_content in addition to or instead of on #section1, then the background color will extend all the way to the bottom edge of the #imageslider block.
Reference: http://www.w3.org/TR/CSS21/visuren.html#block-formatting
Related
I am trying to edit my footer.php in my child-theme (localhost for now, no link to share) in a way that I won't loose the "powered by ..." text. The theme authors (and wordpress too) surely deserve to be referenced there with the great work they do.
I want to add a row with 3 sections, in-line, and above the "footer-menu" and "site-generator" that came with the template. Can you point where the html structure, or the css, is/are incorrect?
Here's what I added to my child-theme footer.php and style.css:
<footer id="colophon" role="contentinfo">
<div class="footer-wrap">
<!-- New inserted code STARTS HERE -->
<div class="engage-row">
<div class="col-1">
<img src="http://localhost/apoise/wp-content/themes/virality-child/images/footer/campaigntest.jpg">
</div>
<div class="col-2">
<img src="http://localhost/apoise/wp-content/themes/virality-child/images/footer/about-engage.jpg">
</div>
<div class="col-3">
<!-- Will add a subscription form here -->
</div>
</div>
<!-- Newly inserted code ENDED HERE -->
<div class="footer-wfix">
<?php virality_footer_nav(); ?>
<div id="site-generator">
<?php echo __('© ', 'virality') . esc_attr( get_bloginfo( 'name', 'display' ) ); ?>
<?php if ( is_front_page() && ! is_paged() ) : ?>
<?php _e('- Powered by ', 'virality'); ?><?php `enter code here`_e('WordPress' ,'virality'); ?>
<?php _e(' and ', 'virality'); ?><?php _e('WP Dev Shed', 'virality'); ?>
<?php endif; ?>
</div>
</div>
In style.css I added:
.col-1{
display: inline;
float: left;
}
.col-2{
display: inline;
float: left;
}
.col-3{
display: inline;
float: left;
}
How can I keep the footer_nav and the site-generator in a new line under the new row I created? Right now they are extending to the right. Or is there a better way to do this?
In your css file you need to add
div.footer-wfix {
clear:left;
}
Should do the trick.
I am trying to set the post title and post excerpt to align under the date beside the featured image but I am only able to set the date but not the title and except.
This is my CSS for the date which is a simple float:
.post-thumbnail {
width: 24%;
float: left;
margin-right: 20px;
}
HTML
<div class="post-meta group">
<p class="post-category"><?php the_category(' / '); ?></p>
<p class="post-date"><?php the_time('j M, Y'); ?></p>
</div><!--/.post-meta-->
<h2 class="post-title">
<?php the_title(); ?>
</h2><!--/.post-title-->
<?php if (ot_get_option('excerpt-length') != '0'): ?>
<div class="entry excerpt">
<?php the_excerpt(); ?>
</div><!--/.entry-->
<?php endif; ?>
When I add float: left to the class .post-meta it moves the title and excerpt but not aligned under the post meta.
This is my new www.gazetbits.com. Any guide would be appreciated or would it be correct to group the title and post except into a Div and apply the float.
Thanks
The .post-meta takes too much height. I achieved your desired behavior adding this rule:
.post-meta {
height: 22px;
}
or changing the display type:
.post-meta {
display: table;
}
first of all, I found that Question here but the answer won't quite fit in my case, which is why I ask a question, that may seem similar but isn't. If that makes sense somehow :-D
I'm creating a childtheme to the "responsive"-Wordpresstheme from cyberchimps.
For that I needed text to shape in 3 columns, but also to be editable in the backend of the Site. I managed that with CCS:
.col-940{
clear: none;
-webkit-column-count: 3; /* Chrome, Safari, Opera */
-webkit-column-gap: 40px;
-moz-column-count: 3; /* Firefox */
-moz-column-gap: 40px;
column-count: 3;
column-gap: 40px;
}
p {
margin: 5px 0px 0px 0px;
}
That now generates the problem, that the first column starts 5px lower than the following ones. I can't figure out why.
As said above the answer in the other thread will not work, because I also have sub-sites that only use 2 columns, which is why I can't use a defined width.
Above/before the div the text is in there always is just another div.
(PHP)container the text is in:
<?php if( have_posts() ) : ?>
<?php while( have_posts() ) : the_post(); ?>
<?php responsive_entry_before(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php responsive_entry_top(); ?>
<div class="post-entry">
<?php the_content( __( 'Read more ›', 'responsive' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="pagination">' . __( 'Pages:', 'responsive' ), 'after' => '</div>' ) ); ?>
</div>
<!-- end of .post-entry -->
<?php responsive_entry_bottom(); ?>
</div><!-- end of #post-<?php the_ID(); ?> -->
<?php
endwhile;
get_template_part( 'loop-nav' );
else :
get_template_part( 'loop-no-posts' );
endif;
?>
(HTML)container as produced by the PHP:
<div id="post-25" class="post-25 page type-page status-publish hentry">
<!--
<h1 class="entry-title post-title">Kontakt</h1>…
-->
<div class="post-entry">
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing …
</p>
</div>
<!-- end of .post-entry -->
</div>
<!--end of #post-25 -->
Screens:
Shot of the Situation
Shot with marked problem
You have applied 5px margin-top and the only place that occurs at the top of a column is at the start of the first one. You need to remove this margin-top, perhaps with
.post-entry > p:first-child {
margin: 0;
}
For me, I needed each item in the column to have a fixed height. It also had problems with vertical alignement. I was able to fix the vertical alignment by having a line-height on the item be the desired height of the item and wrapping the content of the item inside a div.
ul {
column-count: 2;
}
ul > li {
line-height: 30px;
}
ul > li > div {
height: 30px;
line-height: 1.2;
}
I need a table layout that looks like the following:
Cell one (rowspan 2)
Cell two and three (next to cell one and each other)
Cell four (colspan 2 underneath cell two and three)
The problem I am having though is that it needs to be done using CSS only, I can't use any table elements in the Code at all.
Cell 1 also needs to still stretch to a 100% width if Cell 2, 3 and 4 are empty.
I am working on an Artisteer 4 Template in Joomla and have searched all over and just can't get to a working solution.
The code I have is as follows:
<div class="prof-layout-wrapper">
<div class="prof-content-layout">
<div class="prof-content-layout-row">
<div class="prof-layout-cell prof-content">
<?php
echo $view->position('banner2', 'prof-nostyle');
if ($view->containsModules('breadcrumb'))
echo artxPost($view->position('breadcrumb'));
echo $view->positions(array('user1' => 50, 'user2' => 50), 'prof-article');
echo $view->position('banner3', 'prof-nostyle');
echo artxPost(array('content' => '<jdoc:include type="message" />', 'classes' => ' prof-m essages'));
echo '<jdoc:include type="component" />';
echo $view->position('banner4', 'prof-nostyle');
echo $view->positions(array('user4' => 50, 'user5' => 50), 'prof-article');
echo $view->position('banner5', 'prof-nostyle');?>
</div>
<?php if ($view->containsModules('left')) : ?>
<div class="prof-layout-cell prof-sidebar1">
<?php echo $view->position('left', 'prof-block'); ?>
</div>
<?php endif; ?>
<?php if ($view->containsModules('right')) : ?>
<div class="prof-layout-cell prof-sidebar2">
<?php echo $view->position('right', 'prof-block'); ?>
</div>
<?php endif; ?>
</div>
</div>
</div>
The css is:
.prof-layout-wrapper
{
position: relative;
margin: 0 auto 0 auto;
z-index: auto !important;
}
.prof-content-layout
{
display: table;
width: 100%;
table-layout: fixed;
float: left;
}
.prof-content-layout-row
{
display: table-row;
}
.prof-layout-cell
{
display: table-cell;
vertical-align: top;
}
For the life of me I can't get Cell 4 to span accross without destroying the entire layout.
Please help!
(I hope this is a good enough explanation)
Sure!
Demo Fiddle
HTML
<div class='table'>
<div class='row'>
<div class='cell'>cell1</div>
<div class='cell'>
<div class='table'>
<div class='row'>
<div class='cell'>cell2</div>
<div class='cell'>cell3</div>
</div>
<div class='caption'>cell4</div>
</div>
</div>
</div>
</div>
CSS
html, body {
width:100%;
}
.table {
display:table;
width:100%;
}
.row {
display:table-row;
}
.cell {
display:table-cell;
border:1px solid grey;
}
.caption {
display:table-caption;
caption-side:bottom;
border:1px solid grey;
}
If you want the auto expanding/collapse functionality, you can tweak the code slightly, a la this fiddle
I am using the DigG Digg Social Media Plugin for Wordpress using the manual code option:
My HTML is the following but this is not much use as its generated via PHP - I have implemented the media class and the boxes!
What my main issue is how can I get all the icons aligned via the same height?
Live URL
HTML:
<div class="diggSocialMedia">
<div class="box0">
<?php dd_fbshare_generate('Compact') ?>
</div>
<div class="box1">
<?php dd_twitter_generate('Compact','hakatours') ?>
</div>
<div class="box2">
<?php dd_fblike_generate('Like Button Count') ?>
</div>
<div class="box3">
<?php dd_google1_generate('Compact') ?>
</div>
</div>
.diggSocialMedia > div {
vertical-align:top;
}
.diggSocialMedia {
height: 0;
overflow: visible;
}