News:

The anti-spam plugins have stopped being effective. Registration is back to requiring approval. After registering, you must ALSO email me with your username, so that I can manually approve your account.

Main Menu

centre-ing the newsbox

Started by lost eden, August 22, 2006, 10:24:30 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lost eden

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

Omega0

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.

lost eden

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.

Databits

Using align="center" attribute within a div tag is INCORRECT HTML and will not work properly across most modern browsers.

Use the code:


 
instead.
(\_/)    ~Relakuyae D'Selemae
(o.O)    
(")_(")  [Libre Office] [Chrome]

Omega0

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.

Xepher

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.