Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Why isn't my css for these columns working?

Posted on 2015-01-29
7
Medium Priority
?
45 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 143

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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

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

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
Suggested Courses

885 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