Help - Search - Members - Calendar
Full Version: Header Position Using CSS
HTMLHelp Forums > Web Authoring > Cascading Style Sheets
ctoyh
I have a header using text and seem to be having trouble using CSS to position it correctly. I prefer not to use an image to do this. I have the header set to 940px in length and would like the height to be 100px. I am able to position the header in the spot I want using a fixed position. However, when I add more content to the page and if scrolling the text seems to move further down the page.

Can anyone tell me how to position the text to stay centered in the header to the left? I currently have no set hight for the header and have managed to get the text to move from the margin of the header by using margin-left

Here is the site as it stands. http://www.tour-niagara.com

Here is my css code as it stands.
#header {


border-bottom-style: solid;
border-color:#FFFF00;
border-top-style: hidden;
width: 940px;

background-color:#0033CC;
font-family:candara; color:#CCCCCC;



}
.headertext {

margin-left:10px;
font-size:xx-large;
}
pandy
I'm sorry, but I don't understand. The header isn't fixed or positioned otherwise (and I don't see why it would need to be). Also, do you want it centered or to the left? What's wrong with it as it it now?
Darin McGrew
I don't understand what you want to be different. Can you explain in more detail what you expect to see and what you actually see?
ctoyh
QUOTE(Darin McGrew @ Oct 11 2009, 02:32 PM) *

I don't understand what you want to be different. Can you explain in more detail what you expect to see and what you actually see?

Presently, the size of the header is only relative to the size of the text. If I were to make the header div 100px tall, the text would align itself to the top left corner leaving a large amount of space below it.I would like to know how to center it to the left and the middle point of the 100px header div, being the 50px point.
ctoyh
QUOTE(pandy @ Oct 11 2009, 02:23 PM) *

I'm sorry, but I don't understand. The header isn't fixed or positioned otherwise (and I don't see why it would need to be). Also, do you want it centered or to the left? What's wrong with it as it it now?
esently, the size of the header is only relative to the size of the text. If I were to make the header div 100px tall, the text would align itself to the top left corner leaving a large amount of space below it.I would like to know how to center it to the left and the middle point of the 100px header div, being the 50px point.
pandy
Use top and bottom padding rather than hight.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.