Solved

Why isn't my css for these columns working?

Posted on 2015-01-29
7
33 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
Comment Utility
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]
Comment Utility
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
Comment Utility
Can you give me an example of what you mean?

I cleared the cache and disabled the Wordpress cache plugin they had used.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:Donnie Walker
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
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 Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…

763 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

8 Experts available now in Live!

Get 1:1 Help Now