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.
us.homelinux.net is where my page is housed right now.
Wagstaff’s script is found in the article link.
img.center { display: block; margin-left: auto; margin-right: auto; }
html:
img src="blahblahblah.jpg" alt="Blah" class="center"
Close enough?
You do have two separate page types in your folder.. One for the css, and one for the html which references the .css code from the .css page.. The html page is for content and images and the .css page is for structure.
Yes. I have in my main folder my index.html page. It references the CSS style sheet which is in a folder called CSS.
Surrounding things in old-fashioned center /center tags still works, too.
SYNTAX
The float CSS property can accept one of 4 values: left, right, none, and inherit.
http://coding.smashingmagazine.com/2009/10/19/the-mystery-of-css-float-property/
not with this page :(
Your css worked great for a static image, but it busted up my existing class, class=”rotator”
Can you give a link to the page you’re trying to correct?
us.homelinux.net
It looks beautiful on my screen... What are you trying to “correct”?
I would like the rotating images to be in the center below the links.
And thank you. The base template is a free template online. Can’t take too much credit for it. But the images are mine for our church.
On the following site I think that you will be able to find what you need. There are links on the left-hand side of the page for ‘cascading style sheets’ and ‘css keywords’:
Go for it :) It was free too. Again, I’m a newbie to CSS. Started with HTML probably 15 years ago and when the company we had designing our new website just didn’t satisfy, guess who got drafted :) I’m learning, but this one is frustrating. Not centered on my page at all. All the way to the left.
They aren’t centered for me.
Ha! Drafted! Well, you’ve done a nice job over this-a-way... so I don’t know how to help. I love all the images, but especially the Fight, Finish, Faith shot and the group shot too. Nice work... We’re on Linux Ubuntu using Firefox if that is helpful, and like I said, it’s all right-on and centered.
The rotating images are centered on my screen. Sounds like an issue with your browser not reading the html or css properly.
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?
http://www.elated.com/articles/css-center-content/
http://simplebits.com/notebook/2004/09/08/centering/
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).
Thanks, Ponygirl!
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 :)
I’ve been playing around with the div tags, yes. Definitely need to understand more.
If the page is displaying correctly in some browsers but not others, it may be because the browser is not compatible with the CSS. For example, if you want the dwindling number of Explorer 6.0 users to see your page correctly displayed, you may have to write some E6.0-specific CSS code.
To check and see how your page will display in different browsers, you can use free Internet tools such as Adobe Browser Lab or BroswerShots.
Disclaimer: Opinions posted on Free Republic are those of the individual posters and do not necessarily represent the opinion of Free Republic or its management. All materials posted herein are protected by copyright law and the exemption for fair use of copyrighted works.