473,378 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Centering Image Replacement

I have made a website that uses image replacement for the two main
headings. It works beautifully in firefox, but in internet explorer the
images appear too far to the right. Does anyone have any idea of how to
fix this?

The site is at

http://www.cafecreate.org/
Thanks,
Martin
Mar 21 '06 #1
5 2156
Martin Eyles wrote :
I have made a website that uses image replacement for the two main
headings. It works beautifully in firefox, but in internet explorer the
images appear too far to the right. Does anyone have any idea of how to
fix this?

The site is at

http://www.cafecreate.org/
Thanks,
Martin


HTML Tidy reports these errors:
(which can be installed as a Firefox extension)

line 12 column 9 - Warning: <div> isn't allowed in <h1> elements
line 12 column 35 - Warning: discarding unexpected </div>
line 13 column 9 - Warning: <div> isn't allowed in <h2> elements
line 13 column 35 - Warning: discarding unexpected </div>
line 15 column 17 - Warning: missing </a> before <div>
line 15 column 67 - Warning: discarding unexpected </a>
line 17 column 17 - Warning: missing </a> before <div>
line 17 column 74 - Warning: discarding unexpected </a>
line 21 column 32 - Warning: <a> escaping malformed URI reference
line 22 column 32 - Warning: <a> escaping malformed URI reference
line 23 column 17 - Warning: <img> escaping malformed URI reference
line 23 column 17 - Warning: <img> attribute "width" has invalid value
"260px"
line 23 column 17 - Warning: <img> lacks "alt" attribute
http://validator.w3.org/check?uri=ht...line&verbose=1

Why we won't help you
http://diveintomark.org/archives/200..._wont_help_you

Gérard
--
remove blah to email me
Mar 24 '06 #2
Martin Eyles wrote :
I have made a website that uses image replacement for the two main
headings. It works beautifully in firefox, but in internet explorer the
images appear too far to the right. Does anyone have any idea of how to
fix this?

The site is at

http://www.cafecreate.org/
Thanks,
Martin

You also have many CSS errors
http://jigsaw.w3.org/css-validator/v...usermedium=all

and also many useless, unneeded CSS declarations.

Gérard
--
remove blah to email me
Mar 24 '06 #3
Gérard Talbot wrote:
Martin Eyles wrote :
I have made a website that uses image replacement for the two main
headings. It works beautifully in firefox, but in internet explorer
the images appear too far to the right. Does anyone have any idea of
how to fix this?

The site is at

http://www.cafecreate.org/
Thanks,
Martin


HTML Tidy reports these errors:
(which can be installed as a Firefox extension)

line 12 column 9 - Warning: <div> isn't allowed in <h1> elements
line 12 column 35 - Warning: discarding unexpected </div>
line 13 column 9 - Warning: <div> isn't allowed in <h2> elements
line 13 column 35 - Warning: discarding unexpected </div>
line 15 column 17 - Warning: missing </a> before <div>
line 15 column 67 - Warning: discarding unexpected </a>
line 17 column 17 - Warning: missing </a> before <div>
line 17 column 74 - Warning: discarding unexpected </a>
line 21 column 32 - Warning: <a> escaping malformed URI reference
line 22 column 32 - Warning: <a> escaping malformed URI reference
line 23 column 17 - Warning: <img> escaping malformed URI reference
line 23 column 17 - Warning: <img> attribute "width" has invalid value
"260px"
line 23 column 17 - Warning: <img> lacks "alt" attribute
http://validator.w3.org/check?uri=ht...line&verbose=1
Why we won't help you
http://diveintomark.org/archives/200..._wont_help_you

Gérard
--
remove blah to email me


Sorry - Fixed the html - It now validates. I still have the problem (in
IE7) though.
Mar 24 '06 #4
Gérard Talbot wrote:
Martin Eyles wrote :
I have made a website that uses image replacement for the two main
headings. It works beautifully in firefox, but in internet explorer
the images appear too far to the right. Does anyone have any idea of
how to fix this?

The site is at

http://www.cafecreate.org/
Thanks,
Martin

You also have many CSS errors
http://jigsaw.w3.org/css-validator/v...usermedium=all
and also many useless, unneeded CSS declarations.

Gérard
--
remove blah to email me


Sorry - Fixed the CSS now. Unfortunately the CSS can't be completely
fixed, as I have to use the filter hack to get transparent images to
work in IE6. However, this bit of CSS shouldn't affect the headings.
Also, I'm pretty sure the warnings are unrelated too.

Do you have any ideas now on how to fix things?

Thanks,
Martin
Mar 24 '06 #5
Martin Eyles wrote:
Gérard Talbot wrote:
Martin Eyles wrote :
I have made a website that uses image replacement for the two main
headings. It works beautifully in firefox, but in internet explorer
the images appear too far to the right. Does anyone have any idea of
how to fix this?

The site is at

http://www.cafecreate.org/


Sorry - Fixed the CSS now. Unfortunately the CSS can't be completely
fixed, as I have to use the filter hack to get transparent images to
work in IE6. However, this bit of CSS shouldn't affect the headings.
Also, I'm pretty sure the warnings are unrelated too.

Do you have any ideas now on how to fix things?


I see nothing on this page that requires the complexity of png alpha
channel opacity - you can get basic transparency with gif (if you even
need that), and then you can throw away all the unnecessary complexity
introduced by ie's lack of support for png.

Alternatively, if you do have a need for alpha channel opacity:
It seems slightly eccentric to use an empty span to put in a background
image for your title. I'd make it (H1 & H2) a block level element of the
right width instead.

What ie appears to be doing is calculating the width & therefore the
centred position of your titles before the image is loaded, so if your
titles were centred blocks of the right width, your problem would
probably go away.

Your rounded corners have the wrong background colour, btw (white).

Chris
Mar 24 '06 #6

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

Similar topics

2
by: Greg Shannan | last post by:
I normally centre an image using a <p align="center"> ... </p> format, but I understand that this is "deprecated" in the latest standard in favour of styles. The problem is that I cannot find a...
18
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?
2
by: Ryan W Sims | last post by:
I'm having trouble with centering in IE... http://www.ryanwsims.com/koh/ The image should center over the text. It does in Firebird, but not in IE for some reason. If you look at ...
53
by: Kerberos | last post by:
I followed Dan Cederholm's image replacement tutorial, to replace a header tag by a logo. The h1 is clickable if no CSS is applied but it I replace it by the logo, the area isn't clickable anymore...
6
by: Jerry Camel | last post by:
I want to center an image on the screen and have text centered over the image. What's the best way to do this? I've been playing with style tags and I can get the stuff to center automatically...
3
by: John Pote | last post by:
1. Horizontal centering a <divin browser window. The current trend seems to be to place page content in a fixed width area in the middle of the browser window. How is this achieved? If I use a...
2
by: rudicheow | last post by:
SHORT VERSION ============= I have a bunch of identical fixed-size single-celled tables that rest against each other horizontally thanks to "float:left". These tables are dynamically generated...
6
by: Rob | last post by:
Hello, I'm sure this has come up before. I have need for a collection of all elements/objects in an HTML document that have any kind of an attribute (HTML or CSS) that is making use of a URL to...
1
by: neovantage | last post by:
Hey all, I am using a PHP script which creates headings at run time in a sense at page execution. I am stuck a with a very little problem which i am sure i will have the solution from experts. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.