Skip to comments.HTML & CSS Help Needed
Posted on 01/22/2013 7:21:39 PM PST by Blogger
Trying to use Dylan Wagstaff's Rotator at us.homelinux.net. I can't get my main image centered. It's been years since I've done webpages, so I am a complete newbie at CSS. Any help is appreciated.
I tried to do what he suggested in his page, but to no avail. Sure it is my lack of knowledge, but can someone tell me what I need to modify and how I need to modify it?
Been playing around with it for hours and can't figure it out.
Well, I’m on firefox using Windows 7. My work computer doesn’t see them as centered either. So, the infamous browser incompatibility issue :(
Is it only the image rotator that won’t center? Have you tried successfully to center a static image in the same location on the page?
It probably “looks” centered for those with displays set to lower resolutions.
I.E. 9 doesn’t like it either. Could it be Windows 7?
The css code mentioned above centered everything but putting the class in the sheet ripped the images apart and killed the rotating effect. That sounded violent. Must ban CSS!
Anyway, if I could figure out how to use the helpful class=center code above, with the rotator script I might be good to go.
Are you setting the margins?
this looks like what I need! Thank you!
Don't use the div tags as margin/padding around your images (such as the rotator image.) Use the margin and padding properties applied to the element that holds the rotator. Apply margin-left: auto; margin-right: auto; to center rather than "align: center" (which is HTML, not CSS).
I can fix that for you. I’ll Freepmail you the PayPal account to send the $500.00 to.
at this point I’d almost be willing to take you up on it — almost :)
CSS I can’t help you with but for html search FR for a thread called html sandbox
Since the main problem has already been identified a few posts up, I'll add your very good suggestions with a couple of my own.
Use a tool like tidy to unclutter the source and to spot HTML syntax errors. I was going to take a stab at it but was put off by the long lines of text and a hard to read layout of the HTML. White space is good and lines that don't occupy too much horizontal space are easier for the eye to parse.
Also there's a lengthy run of <BR> to force line breaks. This is better (and less fragile) done via CSS. I also see (not on this page) but elsewhere, a use of repeated sequences to force horizontal spacing which is likewise better handled with CSS.
Now that you've evidently got the crux of the problem solved, that's just some after-the-fact stylistic tweakage.
I’m on WinXP and IE8 and they are centered. In IE8 there is an option to select ‘Compatibility View’. I have no idea if that option is available in IE9.
In Safari, the large image appears to be off to the right. There is also a background image, so maybe that is throwing things off?
Have you explored ‘div’ tags? They are the King of web layout as they are layers and no matter where they are on a page they don’t affect anything else nor does anything affect them. If you create a div tag for your image in question, it will be processed by the browser as a layer and is compatible with all current browsers as far as I know.
Yes, I knew the breaks in the HTML were awkward. without them, everything below the rotator went underneath the rotator. HTML I know (at least the old version). Will work on my CSS skills :)