1
Tobias
Problem with clear:both attribute in templates
  • 2006/2/22 17:17

  • Tobias

  • Not too shy to talk

  • Posts: 172

  • Since: 2005/9/13


Hey all,

I'm trying to design a new theme for my site and thought I could try to be cool and do it without tables and only css So here the problem:

Some of the modules, notably CBB, make heavy use in their templates of <br style="clear:both"> to position elements underneath each other, which interfers with my own layout and leads to nasty white spaces, because the next line after these breaks begins underneath everything else, also the side panels. How do I box the modules in a container that contains clear attribute within itself? I don't want to go through all the templates, that looks like a lot of work.

Probably a little confuse my explanation. You can currently see what I'm talking about if you go tohttp://www.xoopsforge.org/modules/article/ With all new XOOPS 3 alpha or what's it called, and article module.

I assume it's not going to be up for long, but it tells me it's a problem that not only I have, so I'm basically trying to dig the expertise
www.affvu.org

2
technigrafa
Re: Problem with clear:both attribute in templates

Ouch, that sounds tricky. I applaud you for going CSS for your formatting. We've started doing that, but so far we have not gotten into editing all the templates for each module we use to strip out the tables and unneccesary formatting.

<RANT>
MODULE DEVELOPERS: Stop using tables and HTML for formatting in your blocks--use DIVS!
</RANT>

I think you may have to search and replace that module for <BR style="clear:both"> and replace with regular <BR> or with clear:none. I haven't seen any other module that use a clear CSS tag--hopefully this is the only module with that in there.

When I view the source on your page I see clear:all, but "all" isn't even a proper option for "clear" in CSS, as far as I know your options are left, right, both and none.

I could be wrong but I don't think wrapping items in a container will help that problem. The clear tag applies to any other floated items on the page I believe.

Good luck!

3
Tobias
Re: Problem with clear:both attribute in templates
  • 2006/2/22 21:27

  • Tobias

  • Not too shy to talk

  • Posts: 172

  • Since: 2005/9/13


Thanks I mean for acknowledging it's tricky, and for suggestions. The URL above is not my page, it seems to be some testpage that has to do with the people at XForge --> Help is on the way, regarding the templates being spaced by clearing elements...

It seems if you float a container, you can prevent its contents from clearing outside elements. That is, if I've only two columns, the main content column right let's say, and float it against a left sidebar, then the "clear" thing doesn't hurt. But I couldn't figure out how to float the center column against both left and right And I didn't realize I'd do away with my IE6 by grabbing the IE7 beta, so now, I have to run through the entire city to see how all that looks on the setup most of my visitors would probably use. Well, someone knows how it goes right, and then all my pains will be in vain.

I was just wondering whether there was some table like container I'm unaware of, into which I could just wrap the content for the time being. For a temporary fix, until someone comes up with the right templates for a css theme. Or something I could do to the <{$block.content}>. Or perhaps a way to quickly replace the <br > s in question with something that does a similar job, even an invisible ruler or something...
www.affvu.org

4
Tobias
Re: Problem with clear:both attribute in templates
  • 2006/4/5 22:36

  • Tobias

  • Not too shy to talk

  • Posts: 172

  • Since: 2005/9/13


... and should anyone else want to know: They have devised a model at CSSCreator which isolates the different columns and floats them all. With that, the clear:both stays in the column where it belongs --> no annoying white space, and no need to change anything in module templates. No problem if one of your html savvy users has the brilliant idea to use clear:both in a post. Sheer happiness Only drawback: Main column has to have a width, fixed or in percent, but I believe that can be nicely arranged as to accomodate a relatively wide array of different screen sizes.

Best thing of all: You go tohttp://www.csscreator.com/version2/pagelayout.php, drop a few details into a form, and get all the css generated. Free! With some of the fixes for IE! Can't beat that, can you?
www.affvu.org

Login

Who's Online

211 user(s) are online (148 user(s) are browsing Support Forums)


Members: 0


Guests: 211


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits