473,785 Members | 2,435 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Centering logo between left and right floats with different widths.

Hi,

I would like to center a logo between left and right floats with
different widths.

The issue is that the logo should be centered with respect to the
window, not the area between the left and right floats.

Is there an easy way to do this?

Amir
Jul 16 '08 #1
5 2218
In article
<bd************ *************** *******@k13g200 0hse.googlegrou ps.com>,
Amir Michail <am******@gmail .comwrote:
Hi,

I would like to center a logo between left and right floats with
different widths.

The issue is that the logo should be centered with respect to the
window, not the area between the left and right floats.

Is there an easy way to do this?

There are a few ways to do this. You might fancy this:

<http://netweaver.com.a u/alt/left_right_midd lePic.html>

--
dorayme
Jul 17 '08 #2
On Jul 16, 7:58*pm, dorayme <doraymeRidT... @optusnet.com.a uwrote:
In article
<bd9a4063-49a3-40f6-a6cf-7af9e45d4...@k1 3g2000hse.googl egroups.com>,
*Amir *Michail <amich...@gmail .comwrote:
Hi,
I would like to center a logo between left and right floats with
different widths.
The issue is that the logo should be centered with respect to the
window, not the area between the left and right floats.
Is there an easy way to do this?

There are a few ways to do this. You might fancy this:

<http://netweaver.com.a u/alt/left_right_midd lePic.html>
This approach doesn't work for me on IE 7 but it's fine with Firefox
and Safari:

http://chatbotgame.com

Here's the html fragment:

<div style="float:le ft">...</div>
<div style="float:ri ght">...</div>
<div style="margin:a uto;width:285px "><A HREF="http://
chatbotgame.com "><img width="285" border="0" src="http://
chatbotgame.com/ChatbotGame/chatbotgamelogo .png"></img></A></div>
<div style="clear:bo th"></div>

Amir
>
--
dorayme
Jul 17 '08 #3
In article
<2d************ *************** *******@k13g200 0hse.googlegrou ps.com>,
Amir Michail <am******@gmail .comwrote:
On Jul 16, 7:58*pm, dorayme <doraymeRidT... @optusnet.com.a uwrote:
In article
<bd9a4063-49a3-40f6-a6cf-7af9e45d4...@k1 3g2000hse.googl egroups.com>,
*Amir *Michail <amich...@gmail .comwrote:
Hi,
I would like to center a logo between left and right floats with
different widths.
The issue is that the logo should be centered with respect to the
window, not the area between the left and right floats.
Is there an easy way to do this?
There are a few ways to do this. You might fancy this:

<http://netweaver.com.a u/alt/left_right_midd lePic.html>

This approach doesn't work for me on IE 7 but it's fine with Firefox
and Safari:

http://chatbotgame.com

Here's the html fragment:

<div style="float:le ft">...</div>
<div style="float:ri ght">...</div>
<div style="margin:a uto;width:285px "><A HREF="http://
chatbotgame.com "><img width="285" border="0" src="http://
chatbotgame.com/ChatbotGame/chatbotgamelogo .png"></img></A></div>
<div style="clear:bo th"></div>

OK, I have not got IE7 right here so can't see what the trouble might be
but I assume you are not worried about the middle dropping out of the
line of the left and right floats? On my example that should not happen
because of the min-width on body. It looks from your implementation that
you have not copied this feature.

Anyway, as I said, there are other ways and IE can be troublesome as it
fails to adhere to standards. Lets try another approach:

<http://netweaver.com.a u/alt/left_right_midd lePic2.html>

Let me know how it goes in IE.

--
dorayme
Jul 17 '08 #4
On Jul 16, 10:55*pm, dorayme <doraymeRidT... @optusnet.com.a uwrote:
In article
<2db21061-cb14-4cb4-a102-6321c1b3d...@k1 3g2000hse.googl egroups.com>,
*Amir *Michail <amich...@gmail .comwrote:
On Jul 16, 7:58*pm, dorayme <doraymeRidT... @optusnet.com.a uwrote:
In article
<bd9a4063-49a3-40f6-a6cf-7af9e45d4...@k1 3g2000hse.googl egroups.com>,
*Amir *Michail <amich...@gmail .comwrote:
Hi,
I would like to center a logo between left and right floats with
different widths.
The issue is that the logo should be centered with respect to the
window, not the area between the left and right floats.
Is there an easy way to do this?
There are a few ways to do this. You might fancy this:
<http://netweaver.com.a u/alt/left_right_midd lePic.html>
This approach doesn't work for me on IE 7 but it's fine with Firefox
and Safari:
http://chatbotgame.com
Here's the html fragment:
* * * * * * <div style="float:le ft">...</div>
* * * * * * <div style="float:ri ght">...</div>
* * * * * * <div style="margin:a uto;width:285px "><A HREF="http://
chatbotgame.com "><img width="285" border="0" src="http://
chatbotgame.com/ChatbotGame/chatbotgamelogo .png"></img></A></div>
* * * * * * <div style="clear:bo th"></div>

OK, I have not got IE7 right here so can't see what the trouble might be
but I assume you are not worried about the middle dropping out of the
line of the left and right floats? On my example that should not happen
because of the min-width on body. It looks from your implementation that
you have not copied this feature.
It turns out that margin:auto only works in IE7 under certain
conditions (see http://www.webdeveloper.com/forum/sh....php?t=151555),
and when it does work, it centers with respect to the available free
area and not with respect to the window.
Anyway, as I said, there are other ways and IE can be troublesome as it
fails to adhere to standards. Lets try another approach:

<http://netweaver.com.a u/alt/left_right_midd lePic2.html>
The problem is that the widths of the left and right divs are unknown
so I can't use this solution.

Amir
Let me know how it goes in IE.

--
dorayme
Jul 17 '08 #5
In article
<c4************ *************** *******@p25g200 0hsf.googlegrou ps.com>,
Amir Michail <am******@gmail .comwrote:
On Jul 16, 10:55*pm, dorayme <doraymeRidT... @optusnet.com.a uwrote:
Anyway, as I said, there are other ways and IE can be troublesome as it
fails to adhere to standards. Lets try another approach:

<http://netweaver.com.a u/alt/left_right_midd lePic2.html>
The problem is that the widths of the left and right divs are unknown
so I can't use this solution.
OK, you want a general solution where either left or right float being
wider gets the image dead centre, try this:

<http://netweaver.com.a u/alt/left_right_midd lePic3.html>

(There is a combined construction to hide stuff from both IE 6 and 7 in
a conditional, I have simply put repeated styles for both)

I use the rel positioning for IE because the pic holder div needs to be
given a 100% width to tell it to calculate middle from the sides of the
viewport (in effect, considering no margins on parents). But this then
drops the div because there is no room for the floats any more! Never
mind, we can up the images into line by pushing it with rel positioning.

There is likely a better solution, but I had fun making this.

--
dorayme
Jul 18 '08 #6

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

Similar topics

2
2365
by: Zeke Koos | last post by:
<body> <div style="position:absolute; left:0px; top:0px; width:780px; height:42px; "> <img src="images/CW---Webpage_01.png" width=780 height=42> </div> <div style="position:absolute; left:0px; top:42px; width:52px; height:488px; "> <img src="images/CW---Webpage_02.png" width=52 height=488> </div>
7
2589
by: Erik Schulp | last post by:
Hi all, I am trying to get a CSS defined layout to center on the page, have tried doing this with the <center></center> tags but than everything is centered, including text etc etc. What should I put into the stylesheet so that, no matter what resolution the viewer's screen is set to, the layout is always displayed centered ? Erik Schulp
18
4215
by: Heath | last post by:
Is it proper to center images in a <div> by using the text-align: center property? Or is there a better way?
9
7237
by: Pierre Jelenc | last post by:
Is there a way to center (horizontally) a UL list of unknown width? I can put it in a DIV that's centered with "margin-left: auto; margin-right: auto;" but I then have to specify a width; otherwise the auto values get set to 0 and there is no centering. The list is generated dynamically, and there is no way to tell in advance how long each item is going to be. Alternatively, is there a good formula to determine with a reasonable...
15
13507
by: red | last post by:
How do I center two side by side divs ? I've been writing css pages for a while but there's one thing tha still eludes me. I can center a div with margin auto. I can place two divs side by side with float. But I can't center two side by side divs. If I float them and give them auto margins, the auto margins are ignored. If I wrap the two floated divs in another div, the two divs have no
13
1957
by: Raffi | last post by:
Hi, We have an application that requires IE. We recently incorporated CSS scroll areas. The scroll fields are supposed to be centered. They are except for IE5 for the Mac. I have tried various suggestions on the net without any luck. I have the code for the whole page below. I've taken out all the Mac specific code that I tried and didn't work. Centering is done by a separate <div> tag. If anyone knows how to get the scroll area to...
2
1788
by: stevieg | last post by:
I know this has been dealt with in previous posts, but i am having a problem with centering the following layout. Can anybody spot where I am going wrong? Thanks! body { text-align:center; margin-left:auto; margin-right:auto; font-color:#ffffff; } #wrapper
14
2528
by: issentia | last post by:
I'm working on this site: http://www.essenceofsoy.com/redesign/index2.html and I'm having a few problems with getting the layout exactly right. 1) When the menu items are rolled over, they cannot be clicked as links unless the mouse pointer is below the word. This happens in both Firefox and IE6. 2) In Firefox, the pink quote banner and two gray form boxes above and below the content aren't centered in the "content" div, and I can't...
1
2287
by: =?Utf-8?B?ZnJhbmt5?= | last post by:
Hello, I've created a table that has two rows that are span across three columns. The third row has three columns, each with an image. The last row is also span accross three columns. The span rows are centering their data. however, the row with three columns, each with images (myimages1-3) are not centering with the rest of the table. Any idea why? Thanks in advance!
0
9645
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
9480
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
10147
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
10091
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
8972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6739
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4050
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
2879
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.