HTML Links and Image header centering

+1 Stephanie Coyle · June 29, 2015
Hi Everyone

I am trying to setup my own website, however I am having a bit of trouble my image and the navigation links. My image width and height is set to 400px & 350px I am using the image as a header instead of title name, but when I try to centre the image it takes up half of my website. I have tried using the code. img {display: block; that did put it in the centre but it didn't make the image smaller. I am now trying this code img.display {width:100%; height:auto; but they didn't change anything. Would I need to make the image smaller so that it doesn't take up half of the website.

This might sound like a stupid question but I have always wondered this. When I am coding the links for my menu navigation bar, do I to create a HTML page as well as a CSS page? I always see web pages ending it about.html I'm just are they also using a .css file?

Any help is greatly appreciated thank you.


Post a Reply


Oldest  Newest  Rating
0 Stephanie Coyle · July 1, 2015
Thank you for reply i tried your centre code and it worked, thank you for your help. I'm still a bit baffled about the links, I'm going to try just creating a HTML page for each link and see how it works with CSS. ????
0 Superman HC · July 1, 2015
If you want to make the link pages identical to the home page, then there is no need for a different css file for every page... just use the concept of id's and classes... and refer to the single css file...usually there is a single css file for a website...

and no question is a stupid question... even bucky would have asked these silly questions that made him the way he is today.. :)
0 Stephanie Coyle · July 1, 2015
Thank you for your knowledge Ravi, I am making an external style sheet, yes I wanted to keep the links on the same page, so that they open the page so that the pages open within the site instead of loading different pages. I am always afraid that some questions are going to be stupid that's why I barely ask questions. I know that true it day pay off in theong run to ask questions I'm just a bit reserved sometimes.

Thank you for your reply you have helped me a lot. I appreciate it.
0 Jeff the Killer · June 30, 2015
(I am still a newbie so don't blame me if i did something wrong )

You could use photoshop to resize the image

or <img src="nameof yourimage.jpg" width="100px" height="100px"> you can adjust the image size to more or less than 100px and the image should be the name of the file.   u could center it using

<center>     <img src="name of your image.jpg" width="100px" height="100px">     </center>

you could use html but it would look "plain"
0 Jeff the Killer · June 30, 2015
0 Jeff the Killer · June 30, 2015
here's a cheap imitation of i made with html and css
0 Jeff the Killer · June 30, 2015
here's another cheap imitation of with html but without css/images/forum/upload/2015-06-30/5804f50dbeaf9b0ffc72d80d5ef8696c.jpg
  • 1

HTML / CSS / Web Design


Discuss, share, ask, learn and teach HTML5 and CSS3.