Jump to content

How do I position my header image at the top all pages?


sonita

Recommended Posts

hello this image(attach file) is header for my website. I have a header on all pages of monotony.But I do not know how to set it on top of the pages are.Please help me and if possible give me a css code for it. tanks I'm waiting.

Link to comment
Share on other sites

One way is to create a header element (it can be a div or a header) and use the image as a background. The header will be the first element of your body. CSS for that might look like this:

.header {    background-image: url("myImage.jpg");    background-repeat: no-repeat;}

But be careful. The image will not show completely if the height of the header is smaller than the height of the image. If that is a problem, set the height or min-height of the header to the height of the image (or more). You may also want to add padding-left to the header that is the width of the image (or a little more) so that the image is not covered by contents of the header, such as text.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...