Solved

Why isn't my css for these columns working?

Posted on 2015-01-29
7
34 Views
Last Modified: 2015-02-04
I have a site here: http://www.lakeviewpantry.org/ that is suppose to have 4 columns where the brown area exists.

My development site: http://www.plumthree.com/lakeview/ works correctly...and I have copied the exact html and css code to the live site but it is not working.

This is my css:

.colmask{width:100%;left:0%;clear:both;float:left;overflow:hidden;position:relative;}

.colmid{right:20%;float:left;width:100%;position:relative;}
.colin{right:28%;float:left;width:100%;position:relative;}
.colleft{right:26%;float:left;width:100%;position:relative;}
.col1{width:24%;left:101%;padding:0px 0px 1em 0px;overflow:hidden;float:left;position:relative;}
.col2{width:24%;left:51%;padding:0px 0px 1em 0px;overflow:hidden;float:left;position:relative;}
.col3{width:26%;left:79%;padding:0px 0px 1em 0px;overflow:hidden;float:left;position:relative;}
.col4{width:18%;left:81%;padding:0px 0px 1em 0px;overflow:hidden;float:left;position:relative;}

Open in new window


and this is my php:

<div class="colmid">

        <div class="colin">

            <div class="colleft">

<div class="col1">
	<?php
	if ( dynamic_sidebar('home_right_2') ) :
	else :
	?>
	<?php endif; ?>             
</div>
<div class="col2">
	<?php
	if ( dynamic_sidebar('home_right_1') ) :
	else :
	?>
	<?php endif; ?>
</div>
<div class="col3">
	<?php
	if ( dynamic_sidebar('home_right_3') ) :
	else :
	?>
	<?php endif; ?>
</div>
<div class="col4">
	<?php
	if ( dynamic_sidebar('home_right_4') ) :
	else :
	?>
	<?php endif; ?>
</div>                
            </div>
        </div>
</div>

Open in new window


As always, any help is appreciated.
0
Comment
Question by:Donnie Walker
  • 5
  • 2
7 Comments
 

Author Comment

by:Donnie Walker
ID: 40579195
Since this is a live site I had to use a table for the four columns as a temp solution.

Still hoping for a css solution.
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 40579321
I would try to use display:table, display: table-row  and display:table-cell for this layout instead of floating, as "floating" is not the right way here.

apart from that, the "issue" you had is eventually coming from cached files?
0
 

Author Comment

by:Donnie Walker
ID: 40579776
Can you give me an example of what you mean?

I cleared the cache and disabled the Wordpress cache plugin they had used.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Donnie Walker
ID: 40580865
I'd settle for a 4 column responsive code example that worked.
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 40581112
here we go with the css and the html as example:CSS
body { display: table; table-layout:fixed ; margin : 0; padding: 0;  height: 100%; width: 100%; position: relative;}
.row  { display: table-row ; width: 100%; background: blue; text-overflow: ellipsis ; text-align:center; }

.cell { display: table-cell;  width: 100%;
}

Open in new window

html body:
<body >
   <div class="row">
         <div class="cell">a</div>
         <div class="cell">b</div>
         <div class="cell">c</div>
  </div>
</body>

Open in new window

0
 

Author Comment

by:Donnie Walker
ID: 40582335
Well, I tested your code in a html file and it worked perfectly.

When I applied it to the header.php of the live site, instead of horizontal it went vertical like my old code.

So, to recap, it works fine on my development server and not on the live server. And the development server is a copy of the live server I made 6 days ago.

I am at a loss.
0
 

Author Closing Comment

by:Donnie Walker
ID: 40588800
Lakeview decided to go back to the stock three column solution and it worked for them.

But I liked your 3 column solution so I'm going to save that code for something else.

Thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How can I create a 3-element, full-width photo grid using Flex? 9 37
CSS Position not returning 2 46
Error on Add method 1 37
Not seen Link button 5 13
When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now