473,803 Members | 4,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to centre relative to page, not floated image


The page at:

<http://www.westmidland birdclub.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?
--
Andy Mabbett
USA imprisons children without trial, at Guantanamo Bay:
<http://news.bbc.co.uk/1/hi/world/south_asia/2970279.stm>
<http://web.amnesty.org/library/Index/ENGAMR510582003 ?open&of=ENG-USA>
Jul 20 '05
16 2901
In article <MP************ ************@ne ws.CIS.DFN.DE>,
po****@spamcop. net says...
In article <wl************ **@pigsonthewin g.org.uk>, usenet200305
@pigsonthewing. org.uk says...
In message <MP************ ************@ne ws.CIS.DFN.DE>, Jacqui or Pete
<po****@spamcop .net> writes


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

.... Center h1 text, foreground image to the left

I thought maybe this might work, but no good in Opera...

http://porjes.haxorz.org/bird2.html
Jul 20 '05 #11
In article <le************ **@pigsonthewin g.org.uk>, Andy Mabbett
<us***********@ pigsonthewing.o rg.uk> wrote:
In message <bH5Qa.48527$Ph 3.3769@sccrnsc0 4>, Brian
<br***@wfcr.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.westmidland birdclub.com/club/logo.htm>
(which has two logos, top left and right
<http://www.westmidland birdclub.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/>
Jul 20 '05 #12
In message <aa************ *************** *****@4ax.com>, Stephen Poley
<sb*****@xs4all .nl> writes
<http://www.westmidland birdclub.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.


Thank you. That seems to work, degrades gracefully and I can't see any
pitfalls.

There's an example at:

<http://www.pigsonthewi ng.org.uk/club/test.htm>

with the DIV in question given, temporarily, a red background.
--
Andy Mabbett
USA imprisons children without trial, at Guantanamo Bay:
<http://news.bbc.co.uk/1/hi/world/south_asia/2970279.stm>
<http://web.amnesty.org/library/Index/ENGAMR510582003 ?open&of=ENG-USA>
Jul 20 '05 #13
Leonard Blaisdell wrote:

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.

Jul 20 '05 #14
In message <3f********@new s.sihope.com>, kchayka
<kc*********@si hope.com> writes
Why not just set right margin or padding instead?


for example..?
--
Andy Mabbett
USA imprisons children without trial, at Guantanamo Bay:
<http://news.bbc.co.uk/1/hi/world/south_asia/2970279.stm>
<http://web.amnesty.org/library/Index/ENGAMR510582003 ?open&of=ENG-USA>
Jul 20 '05 #15
Andy Mabbett wrote:
In message <3f********@new s.sihope.com>, kchayka
<kc*********@si hope.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.

Jul 20 '05 #16
In message <MP************ ************@ne ws.CIS.DFN.DE>, Jacqui or Pete
<po****@spamcop .net> writes
>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.

...
There's an example at:

<http://www.pigsonthewi ng.org.uk/club/test.htm>

404 - not found.

Doh! Wrong website:

<http://www.westmidland birdclub.com/club/test.htm>

sorry.
--
Andy Mabbett
USA imprisons children without trial, at Guantanamo Bay:
<http://news.bbc.co.uk/1/hi/world/south_asia/2970279.stm>
<http://web.amnesty.org/library/Index/ENGAMR510582003 ?open&of=ENG-USA>
Jul 20 '05 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
11019
by: Ken Kast | last post by:
Here's my situation. I have a statically positioned table that has an image in a cell. I also have some layers, defined by absolute-positioned DIVs for some animation. Everything works until I scroll/resize. Then the image "moves" on the screen but the animation doesn't. The net effect is that their relative positioning changes. I'd like to have it be that they would stay in the same relative position. I want to keep the image as an...
1
2399
by: Graham J | last post by:
I submitted a variation on this on the Opera forum but I thought I'd bring it up here too as a more general HTML query. Consider this code (I've shown it the old fashioned presentational way but the same problem would happen with CSS): <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Changed behaviour in Opera 7.21</title>
0
2354
by: Mike Kozlowski | last post by:
I have an absolutely positioned block on the top of my page, a block floated left, and a third block in the normal flow. IE6 and Mozilla 1.4 disagree on where the floated block should be placed -- IE thinks its top margin should be relative to the containing block (i.e., the body), while Mozilla thinks it should be relative to the bottom of the absolutely positioned block. My instincts, of course, are to assume that Mozilla's correct --...
4
8280
by: boclair | last post by:
Is this a known problem with IE6? I have a provisional two column layout, the left menu column is positioned absolute. The contents column is positioned relative. The contents column has an image floated right. The placement is there in IE6 but not the image. It does not matter whether the DTD is strict or transitional
17
3051
by: George Hester | last post by:
http://tinyurl.com/5uj6w The lower middle icon the "block" should not drop down when the mouse is over it. How can I stop that? Also the navigation divs both top and bottom should follow the scroll right. Both of these issues occur in IE 6 but not in IE 5.5. You can get the horizontal scroll bar for the window by increasing the size of the image wider than the display area of the window. Assumes 600x800 default display size. Thanks...
2
3875
by: Martin Geisler | last post by:
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQBDNmLx6nfwy35F3TgRAtjIAJ9ryEjr0kaaEapRD0z1bHQYmKi+1wCdEOZC /wY2033SyIVl0za07v8RMkk= =6BZ+ -----END PGP SIGNATURE-----
13
2471
by: Griff | last post by:
Hi Sorry no screen shots or links...I want to achieve the following visual effect: I want three boxes to appear on screen, all within a parent box (so 4 in total). Concerning the three inner boxes, I want them to appear in a two column format. One box in the left hand column that will contain an image and
7
9306
by: Cruelemort | last post by:
All, I have a div in my page that has a set width of 1000px, height of 200px, inside this i declare two more div's, both relatively positioned and floated left, the first is placed to the top left of the box and is a 30px square, the other one is set to 970px and is naturally positioned next to the square and so fills all the way to the right hand edge of the box. Now i need the second (wider) box to overlap the square and so start
0
9703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9564
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10548
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10295
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.