Xepher.Net Forums

Xepher.net => Technical Support => Topic started by: lost eden on August 22, 2006, 10:24:30 AM

Title: centre-ing the newsbox
Post by: lost eden on August 22, 2006, 10:24:30 AM
Can the newsbox be centred? In the example page;

Quote$align_box = "none" ;
//Which side to place the newsbox, with the rest of the page flowing around it. Can be "left", "right", or "none" to disable wrapping
But there's no option to centre it... It just looks a bit strange as the rest of my home page is centre-aligned

http://imagesofeden.xepher.net
Title: centre-ing the newsbox
Post by: Omega0 on August 22, 2006, 01:14:15 PM
Try placing the newsbox inside a centered HTML element like http://omega0.xepher.net/stuff/test.php









I believe the left/right setting on the newsbox is similar to that for the IMG tag--it pushes the element off to one side so that there's room for text next to it.

There are probably a few other ways to do it, such as sticking it into a table cell and playing with the width parameter to get things lined up.
Title: centre-ing the newsbox
Post by: lost eden on August 22, 2006, 02:11:14 PM
I probably should've mentioned that I'd already tried that, unfortunately to no avail. I suppose I could make a 3*1 table & put it in the centre cell... Might have a try at that later.
Title: centre-ing the newsbox
Post by: Databits on August 22, 2006, 04:06:53 PM
Using align="center" attribute within a div tag is INCORRECT HTML and will not work properly across most modern browsers.

Use the code:


 
instead.
Title: centre-ing the newsbox
Post by: Omega0 on August 22, 2006, 10:15:15 PM
The CSS doesn't work though (that's what's imagesofeden.xepher.net is using right now).
http://omega0.xepher.net/stuff/test2.php <-- using CSS
ALIGN may be depreciated now, but is was valid up to HTML 3.2 so you can be pretty sure it will work provided you don't try to do something fancy (works in FireFox 1.5, Opera 9 and IE 6 at least).

I admit it's dirty/cheating, but it's the lesser of the ugly methods.
Title: centre-ing the newsbox
Post by: Xepher on August 23, 2006, 02:00:25 AM
The "align_newsbox" variable actually sets the css "float" value for the newsbox. That is, if you put in the newsbox in a big chunk of text, you can choose which side it flows around. I'll admit, my notes in the code could be clearer on that, however, they describe what effectively happens if you don't have any complex elements in your page... that is, if it's just a big block of text. Anyway, you'll need to use your own page layout to center the newsbox. Technically I believe you're supposed to use the method Data mentions. The other one I read should center it is margins: auto. It works in firefox, but not in IE. See the front page of xepher.net for example. The main white box should be centered, with the little grey lines equally on both sides. Great in firefox, sucks in IE.