Jump to content

Centering an Image


Viper5646
 Share

Recommended Posts

Hi I Just finished the CSS tutorial and created a Navigation bar where one of the menus opens an Image.This Image replaces the navigation bar and is placed at the top left .How can I place the image in the center and still leave the navigation bar displayed.
Here is my HTML and CSS code.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><link rel="stylesheet" type="text/css"href="NavigationBar.new.css" /></head><body><ul ><li ><a href="images\Nathan.jpg">Home</a></li><li ><a href="images\linda-e-exuberante.jpg">Images</a></li><li><a href="Videos">Videos</a></li></ul></div></body></html>

ul{list-style:none; margin:0;	  padding:50px	padding-bottom:5px;}a:link,a:visited{font-weight:bold;color:black;background-color:red;text-align:left;padding:22px;text-decoration:nonetext-transform:uppercase;}li{float:left;display:inline;}a:hover,a:active{background-color:#C00000;color:white;} a{display:block;width:50px;}

Thank you

Link to comment
Share on other sites

Umm, you have to create a new page that includes both the menu bar and the image. Note that you are supposed to use forward slashes for your paths.1089: images are inline elements, so you center them like normal 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
 Share

×
×
  • Create New...