HighDots Forums  

Re: How to centre relative to page, not floated image

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Re: How to centre relative to page, not floated image in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Brian
 
Posts: n/a

Default Re: How to centre relative to page, not floated image - 07-12-2003 , 10:01 AM






Andy Mabbett wrote:
Quote:
http://www.westmidlandbirdclub.com/club/logo.htm

has a logo "floated" in the top left, and another "floated" in the
top right, with the H1 heading centred between them (and this
centred on the page).

I would like to only have the logo top left, but retain the
centering of the heading, on the page.

How is this best achieved?
float takes the item of the normal document flow, so it will not
affect margins set on the h1. Thus,

h1 {margin-left: auto; margin-right: auto}

float the image left as before.

--
Brian
follow the directions in my address to email me



Reply With Quote
  #2  
Old   
Brian
 
Posts: n/a

Default Re: How to centre relative to page, not floated image - 07-12-2003 , 11:59 PM






Andy Mabbett wrote:

Quote:
float takes the item of the normal document flow, so it will not
affect margins set on the h1. Thus,

h1 {margin-left: auto; margin-right: auto}

float the image left as before.

Compare the common centring of the H1 ("West Midland Bird Club"), H2
("New Logo") and the large graphic on:

http://www.westmidlandbirdclub.com/club/logo.htm

(which has two logos, top left and right

http://www.westmidlandbirdclub.com/club/test.htm

which has one.
Both have css errors. Does fixing them solve anything? Probably not,
but one can always hope.

--
Brian
follow the directions in my address to email me



Reply With Quote
  #3  
Old   
Stephen Poley
 
Posts: n/a

Default Re: How to centre relative to page, not floated image - 07-14-2003 , 02:03 PM



On Sat, 12 Jul 2003 17:15:02 +0100, Andy Mabbett
<usenet200305 (AT) pigsonthewing (DOT) org.uk> wrote:

Quote:
In message <EpVPa.44171$H17.13526@sccrnsc02>, Brian
brian (AT) wfcr (DOT) org.invalid-remove-this-part> writes
http://www.westmidlandbirdclub.com/club/logo.htm
has a logo "floated" in the top left, and another "floated" in the
top right, with the H1 heading centred between them (and this
centred on the page).
I would like to only have the logo top left, but retain the
centering of the heading, on the page.
How is this best achieved?

float takes the item of the normal document flow, so it will not
affect margins set on the h1. Thus,

h1 {margin-left: auto; margin-right: auto}

float the image left as before.

Thank you, but that doesn't seem to work.
This will only work if you also "shrink" the width of the header to
something less than 100%. e.g: width: 15em. (you'll have to play to get
an appropriate size). Or alternatively just leave an empty DIV on the
right, of the same width as the logo.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/


Reply With Quote
  #4  
Old   
AT
 
Posts: n/a

Default Re: How to centre relative to page, not floated image - 07-15-2003 , 03:16 AM



In article <lem8oT8UyOE$EwA5 (AT) pigsonthewing (DOT) org.uk>, Andy Mabbett
<usenet200305r (AT) pigsonthewing (DOT) org.uk> wrote:

Quote:
In message <bH5Qa.48527$Ph3.3769@sccrnsc04>, Brian
brian (AT) wfcr (DOT) org.invalid-remove-this-part> writes
Compare the common centring of the H1 ("West Midland Bird Club"), H2
("New Logo") and the large graphic on:
http://www.westmidlandbirdclub.com/club/logo.htm
(which has two logos, top left and right
http://www.westmidlandbirdclub.com/club/test.htm
which has one.

Both have css errors.

Fixed, thank you.

Does fixing them solve anything?

No :-(
And now for the tacky solution. Do everything as you have and use a
transparent gif of the appropriate size on the right hand side :-)

leo

--
<http://web0.greatbasin.net/~leo/>


Reply With Quote
  #5  
Old   
kchayka
 
Posts: n/a

Default Re: How to centre relative to page, not floated image - 07-15-2003 , 03:11 PM



Leonard Blaisdell wrote:
Quote:
And now for the tacky solution. Do everything as you have and use a
transparent gif of the appropriate size on the right hand side :-)
Why not just set right margin or padding instead?

--
To email a reply, remove (dash)ns(dash). Mail sent to the ns
address is automatically deleted and will not be read.



Reply With Quote
  #6  
Old   
kchayka
 
Posts: n/a

Default Re: How to centre relative to page, not floated image - 07-15-2003 , 05:19 PM



Andy Mabbett wrote:

Quote:
In message <3f1460c7$1 (AT) news (DOT) sihope.com>, kchayka
kcha-ns-yka (AT) sihope (DOT) com> writes
Why not just set right margin or padding instead?

for example..?
h1 { margin-right: 132px; }

That is the width of the left-floated image plus its margin, no?

--
To email a reply, remove (dash)ns(dash). Mail sent to the ns
address is automatically deleted and will not be read.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.