Gullydwarf
12-21-2010, 10:35 PM
Hey all,
This is my first post here so I hope you'll forgive me if I break some rules.
I've been looking for tips on using CSS to align elements for my new website. I am pretty new at this structure but familiar with syntax.
I am trying to get a nice header together for my website. It contains two elements; a logo and a title, which should join nicely.
My logo is 100px high so that's what I want my header to be. I set all the margins and padding to zero and made a bottom border. Inside the header div I made two divs. One containing the logo and the other containing my title text.
I want them centered. The header div should be centered so the complete combination hangs neatly in the center. But now I got the logo div floating left and the text div floating right, so they're as far apart as my screen allows them to be.... How do I get them neatly next to eachother in the center?
I have a working solution with tables, but ran into another problem of the content div overflowing into my header div somehow. Making my menu renderend above the bottom border of the header div. (the border was a <hr> back then, now it's a border-bottom) And someone also told me tables was bad practice.
I hope someone can help me without me having to give out my code because I am working on some sensitive stuff.
This is my first post here so I hope you'll forgive me if I break some rules.
I've been looking for tips on using CSS to align elements for my new website. I am pretty new at this structure but familiar with syntax.
I am trying to get a nice header together for my website. It contains two elements; a logo and a title, which should join nicely.
My logo is 100px high so that's what I want my header to be. I set all the margins and padding to zero and made a bottom border. Inside the header div I made two divs. One containing the logo and the other containing my title text.
I want them centered. The header div should be centered so the complete combination hangs neatly in the center. But now I got the logo div floating left and the text div floating right, so they're as far apart as my screen allows them to be.... How do I get them neatly next to eachother in the center?
I have a working solution with tables, but ran into another problem of the content div overflowing into my header div somehow. Making my menu renderend above the bottom border of the header div. (the border was a <hr> back then, now it's a border-bottom) And someone also told me tables was bad practice.
I hope someone can help me without me having to give out my code because I am working on some sensitive stuff.