there is no such thing as float:top; (only left | right | none) . If you were to float this element then margins-right/left:auto would not be applicable.
here ONE an example of what I think you are trying to accomplish.
to be honest , you ahve to take your whole code into consideration, as you should start to style only after you have structured your HTML around your content. ( for example… is the image content or deco rational, if it’s content can it be considered part of the H1? …etc etc…)
hope that helps
UPDATE: Just figured it out! I think you’re all right in some ways!! It’s because I didn’t specify the width of my h1 that it stopped working when I was using the auto margin-left and margin-right!
Thank you for the welcome. Can you see the image now by any chance? Thanks for telling me there’s no float:top property! That’s embarrassing I thought it existed. I tried to pad it out by 12px but it doesn’t shrink to fit the 1000px width I’ve set (header banner image). The h1 I’m trying to set is supposed to be in line with the 1000px width of the header.
Thank you for your help. I appreciate the code example. I have coded up my index page with the div classes but for some reason I still can’t get it right. I’ve tried your suggestions. My wrap is like yours, the header img is at the top of the page (how I want it) but I need the Home Page bar to fit in line with the header img.
Thank you for your help. I’ve tried to comment out some of my CSS and use a bit of your demo code but for some reason, I still can’t get it to work.
The thing about HTML and CSS is that they work together. dresden_phoenix summed it up very nicely…
CSS and HTML not only depend on one another, they also depend on their own relatives, too. It takes a bit of experience before one learns how to copy bits and pieces from other code and use them in one’s own.
For example, if you copy the full page examples presented above by dresden_phoenix or me, and paste them on a stand-alone page, they will all work. Each example is a stand-alone unit.
As your knowledge grows, you will learn how to selects features from one page and apply them to your own. In the beginning, before dismissing our examples as unworkable, be sure to give them a look on their own pages to see what we are demonstrating.
Everything exists in the context of its surroundings.
If you can post a link to your page, we will be happy to offer some guidance. Or, if you can post your HTML and CSS in a message, we can work with that, too. In your message, type
then paste your code here
That will put it in a box with scroll bars (like ours above) and preserve formatting.
Without being able to see your code, everything we can offer at this stage is a “guess”.