SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot Uzzz's Avatar
    Join Date
    Oct 2004
    Location
    canada
    Posts
    157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    css image center prob in firefox etc

    hello, heres a nice easy question for ya.....having problems centering my image on firefox,mac etc....looks fine on IE...i hear thats the prob


    body {
    font-family: Verdana, Arial, sans-serif;
    font-size: 13px;
    background-color: #333333;
    color: white;
    margin: 5;
    text-align: center;
    }

    /* Style for all table cells. */
    td {
    font-family: Arial, sans-serif;
    font-size: 10px;
    }



    /* Put a border on all generated images */
    .image {
    border-width: 1;
    border-color: #888888;
    border-style: solid;
    margin-left: 0 auto;
    margin-right: 0 auto;



    ya i just dont know...cant...look anymore....need rest!
    any help appreciated, dank u

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are a few syntax errors in there. Try this:
    Code:
    .image {
      display:block;
      border:1px solid #888;
      margin-left:auto;
      margin-right:auto;
    }
    You must specify a unit for border-width (unless it's 0). You cannot specify two values for margin-left and margin-right.
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Zealot Uzzz's Avatar
    Join Date
    Oct 2004
    Location
    canada
    Posts
    157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey, thx for reply

    but still will only work for IE...hmmm, heres the whole code...im stumped

    Code:
    body {
    	font-family: Verdana, Arial, sans-serif;
    	font-size: 13px;
    	background-color: #333333;
    	color: white;
    	margin: 5;
    	text-align: center;
    }
    
    /* Style for all table cells. */
    td {
    	font-family: Arial, sans-serif;
    	font-size: 10px;
    	
    	
    }
    
    
    
    /* Put a border on all generated images */
    .image {
      display:block;
      border:1px solid #888;
      margin-left:auto;
      margin-right:auto;
    }
    
    
    
    
    .nav {
    	font-weight: bold;
    	font-size: 26px;
    }
    
    
    /* Align the content of the cells on the index pages to the center. */
    #index td {
    	text-align: center;
    }
    
    /* Remove the margin under the images on the index pages. */
    #index .image {
    	margin-left: 2;
    	margin-right: 2;
    	margin-bottom: 0;
    }
    
    
    /* Highlight the image name on the slide pages. */
    #slide .name {
    	font-weight: bold;
    	font-size: 14px;
    }
    
    /* Header */
    h1 {
    	font-size: 30px;
    	font-weight: bold;
    }
    
    /* Custom link styles */
    a:active {
    	text-decoration: none;
    	color: #FFAAAA;
    }
    
    a:visited {
    	text-decoration: none;
    	color: #AAAAAA;
    }
    
    a:hover {
    	text-decoration: underline;
    	color: #FFFFFF
    }
    
    a:link {
    	text-decoration: none;
    	color: #CCCCCC
    }
    
    #imageinfo {
    	visibility: hidden;
    }

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In the rule for #index .image, you still have horizontal margins without a unit. 2 what?

    Are you sure that you assign the class "image" to the images in question?
    Birnam wood is come to Dunsinane

  5. #5
    SitePoint Zealot Uzzz's Avatar
    Join Date
    Oct 2004
    Location
    canada
    Posts
    157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    awsome! i think i got it....thanks alot man


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •