Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Why isn't my css for these columns working?

Posted on 2015-01-29
7
Medium Priority
?
43 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
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…
Suggested Courses

722 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