Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. whitespace around css background

whitespace around css background

Scheduled Pinned Locked Moved Web Development
csharpphpcssgraphicsquestion
6 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pmcnally
    wrote on last edited by
    #1

    I havn't been able to remove white space around my back ground graphics in the table. I put the background in the tag, and now I've tried it in a div tag, but neither will remove the space around the image. I've tried a lot of things with padding and margins, but nothing has worked yet. You can view the page here or below in the code box =) http://patrickmcnally.serverpowered.net/pball/get.php?cat=Guns&page\_num=1# [code] a:link { color: #00000; text-decoration: none;} a:visted { color: #00000; text-decoration: none;} a:hover, a:active { color: #00000; text-decoration: none;} #pics1 a.picsClass { margin: 0px 0px 0px 0px; width: 125px; height: 70px; color: #00000; text-decoration: none; font: 2px; line-height: 10%; } td { overflow: hidden; } table { padding: 0px 0px 0px 0px; } #mainTable td { margin: 0px 0px 0px 0px; max-width: 125px; max-height: 70px; width:expression( document.body.clientWidth > (500/12) * parseInt(document.body.currentStyle.fontSize)? "125px": "auto" ); font: 2px; line-height: 10%; } <!-- note the reversed pic1_name/pic1 from php --> function populateBox2(title, desc, pic1_name, pic2_name, pic3_name, pic4_name, pic5_name, pic1, pic2, pic3, pic4, pic5) { title = title.replace(/!!!/g, "\'"); desc = desc.replace(/!!!/g, "\'"); title = title.replace(/&&&/g, "\""); desc = desc.replace(/&&&/g, "\""); text1 = "<h2>"+title+"</h2>"+desc+"<br><br><a href=\"#\" onClick=\'populateBox1(\""+pic1+"\"); return false\'>"+pic1_name+"</a> "; if (pic2 != "") { text1 = text1 + "<a href=\"#\" onClick=\'populateBox1(\""+pic2+"\"); return false\'>"+pic2_name+"</a> "; } if (pic3 != "") { text1 = text1 + "<a href=\"#\" onClick=\'populateBox1(\""+pic3+"\"); return false\'>"+pic3_name+"</a> "; } if (pic4 != "") { text1 = text1 + "<a href=\"#\" onClick=\'populateBox1(\""+pic4+"\"); return false\'>"+pic4_name+"</a> "; } if (pic5 != "") { text1 = text1 + "<a href=\"#\" onClick=\'populateBox1(\""+pic5+"\"); return false\'>"+pic5_name+"</a> "; } //alert(text1); populateBox1(pic1); document.getElementById("box2").innerHTML = text1; } function populateBox1(picName) { document.getElementById("box1div").innerHTML = "<img src=\"images/" + picName + "\" id=\"box1\">"; //alert(picName); //document.getElementById("box1").src = "images/" + picName; var h = document.getElementById("box1").height; var w = docu</x-turndown>

    G C 2 Replies Last reply
    0
    • P pmcnally

      I havn't been able to remove white space around my back ground graphics in the table. I put the background in the tag, and now I've tried it in a div tag, but neither will remove the space around the image. I've tried a lot of things with padding and margins, but nothing has worked yet. You can view the page here or below in the code box =) http://patrickmcnally.serverpowered.net/pball/get.php?cat=Guns&page\_num=1# [code] a:link { color: #00000; text-decoration: none;} a:visted { color: #00000; text-decoration: none;} a:hover, a:active { color: #00000; text-decoration: none;} #pics1 a.picsClass { margin: 0px 0px 0px 0px; width: 125px; height: 70px; color: #00000; text-decoration: none; font: 2px; line-height: 10%; } td { overflow: hidden; } table { padding: 0px 0px 0px 0px; } #mainTable td { margin: 0px 0px 0px 0px; max-width: 125px; max-height: 70px; width:expression( document.body.clientWidth > (500/12) * parseInt(document.body.currentStyle.fontSize)? "125px": "auto" ); font: 2px; line-height: 10%; } <!-- note the reversed pic1_name/pic1 from php --> function populateBox2(title, desc, pic1_name, pic2_name, pic3_name, pic4_name, pic5_name, pic1, pic2, pic3, pic4, pic5) { title = title.replace(/!!!/g, "\'"); desc = desc.replace(/!!!/g, "\'"); title = title.replace(/&&&/g, "\""); desc = desc.replace(/&&&/g, "\""); text1 = "<h2>"+title+"</h2>"+desc+"<br><br><a href=\"#\" onClick=\'populateBox1(\""+pic1+"\"); return false\'>"+pic1_name+"</a> "; if (pic2 != "") { text1 = text1 + "<a href=\"#\" onClick=\'populateBox1(\""+pic2+"\"); return false\'>"+pic2_name+"</a> "; } if (pic3 != "") { text1 = text1 + "<a href=\"#\" onClick=\'populateBox1(\""+pic3+"\"); return false\'>"+pic3_name+"</a> "; } if (pic4 != "") { text1 = text1 + "<a href=\"#\" onClick=\'populateBox1(\""+pic4+"\"); return false\'>"+pic4_name+"</a> "; } if (pic5 != "") { text1 = text1 + "<a href=\"#\" onClick=\'populateBox1(\""+pic5+"\"); return false\'>"+pic5_name+"</a> "; } //alert(text1); populateBox1(pic1); document.getElementById("box2").innerHTML = text1; } function populateBox1(picName) { document.getElementById("box1div").innerHTML = "<img src=\"images/" + picName + "\" id=\"box1\">"; //alert(picName); //document.getElementById("box1").src = "images/" + picName; var h = document.getElementById("box1").height; var w = docu</x-turndown>

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Please only post the relevant code. --- b { font-weight: normal; }

      P 1 Reply Last reply
      0
      • G Guffa

        Please only post the relevant code. --- b { font-weight: normal; }

        P Offline
        P Offline
        pmcnally
        wrote on last edited by
        #3

        Its all relevant minus the html and body tags =) Light and Love to you all -Patrick Arden McNally

        G 1 Reply Last reply
        0
        • P pmcnally

          Its all relevant minus the html and body tags =) Light and Love to you all -Patrick Arden McNally

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          You got to be kidding. What does all that code have to do with the problem? Half of the code is even inside html comments, I can hardly see how that code could be relevant to anything at all. --- b { font-weight: normal; }

          1 Reply Last reply
          0
          • P pmcnally

            I havn't been able to remove white space around my back ground graphics in the table. I put the background in the tag, and now I've tried it in a div tag, but neither will remove the space around the image. I've tried a lot of things with padding and margins, but nothing has worked yet. You can view the page here or below in the code box =) http://patrickmcnally.serverpowered.net/pball/get.php?cat=Guns&page\_num=1# [code] a:link { color: #00000; text-decoration: none;} a:visted { color: #00000; text-decoration: none;} a:hover, a:active { color: #00000; text-decoration: none;} #pics1 a.picsClass { margin: 0px 0px 0px 0px; width: 125px; height: 70px; color: #00000; text-decoration: none; font: 2px; line-height: 10%; } td { overflow: hidden; } table { padding: 0px 0px 0px 0px; } #mainTable td { margin: 0px 0px 0px 0px; max-width: 125px; max-height: 70px; width:expression( document.body.clientWidth > (500/12) * parseInt(document.body.currentStyle.fontSize)? "125px": "auto" ); font: 2px; line-height: 10%; } <!-- note the reversed pic1_name/pic1 from php --> function populateBox2(title, desc, pic1_name, pic2_name, pic3_name, pic4_name, pic5_name, pic1, pic2, pic3, pic4, pic5) { title = title.replace(/!!!/g, "\'"); desc = desc.replace(/!!!/g, "\'"); title = title.replace(/&&&/g, "\""); desc = desc.replace(/&&&/g, "\""); text1 = "<h2>"+title+"</h2>"+desc+"<br><br><a href=\"#\" onClick=\'populateBox1(\""+pic1+"\"); return false\'>"+pic1_name+"</a> "; if (pic2 != "") { text1 = text1 + "<a href=\"#\" onClick=\'populateBox1(\""+pic2+"\"); return false\'>"+pic2_name+"</a> "; } if (pic3 != "") { text1 = text1 + "<a href=\"#\" onClick=\'populateBox1(\""+pic3+"\"); return false\'>"+pic3_name+"</a> "; } if (pic4 != "") { text1 = text1 + "<a href=\"#\" onClick=\'populateBox1(\""+pic4+"\"); return false\'>"+pic4_name+"</a> "; } if (pic5 != "") { text1 = text1 + "<a href=\"#\" onClick=\'populateBox1(\""+pic5+"\"); return false\'>"+pic5_name+"</a> "; } //alert(text1); populateBox1(pic1); document.getElementById("box2").innerHTML = text1; } function populateBox1(picName) { document.getElementById("box1div").innerHTML = "<img src=\"images/" + picName + "\" id=\"box1\">"; //alert(picName); //document.getElementById("box1").src = "images/" + picName; var h = document.getElementById("box1").height; var w = docu</x-turndown>

            C Offline
            C Offline
            Chetan visodiya
            wrote on last edited by
            #5

            Hi , You write the following code in body tag topmargine="0" rightmargin="0" leftmargin="0" bottom margin="0" and also write cellspacing="0" and cellpadding="0" in every table tag Chetan Visodiya

            J 1 Reply Last reply
            0
            • C Chetan visodiya

              Hi , You write the following code in body tag topmargine="0" rightmargin="0" leftmargin="0" bottom margin="0" and also write cellspacing="0" and cellpadding="0" in every table tag Chetan Visodiya

              J Offline
              J Offline
              jcrussell
              wrote on last edited by
              #6

              Chetan.visodiya wrote:

              in every table tag

              just put that into your css file. Saves you having to put it all over the place Jason

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups