5 Replies Latest reply on Oct 24, 2006 6:57 AM by Newsgroup_User

    Need help w/ CSS image border in table!

    firmana
      here is my code:

      <tr height="250">
      <td class="covercell"><img src="../images/noimage.gif" border="1">
      </td>
      <td class="covercell"><img src="../images/noimage.gif" border="1">
      </td>
      <td class="covercell"><img src="../images/noimage.gif" border="1">
      </td>
      </tr>

      the table code is in there but this is just one of the rows. I have #covercell just to align the image to the center. I wanted to have .gif" class="imageborder"> and then have a border of 1. I have marked the border for imageborder as 1px. Do I need the px? And also, when would I do img#imageborder or just #imageborder? Thanks.
        • 1. Re: Need help w/ CSS image border in table!
          Level 7
          > <tr height="250">

          Height values on <tr> and <td> is deprecated. There's really no need for
          it.

          > I have #covercell just to align the image to the center

          But it's a class selector not an ID selector, so it should be .covercell,
          no?

          > <td class="covercell"><img src="../images/noimage.gif" border="1">

          > I wanted to have .gif"
          > class="imageborder"> and then have a border of 1. I have marked the border
          > for
          > imageborder as 1px. Do I need the px?

          All CSS numeric values need units (except for zeros). Those without units
          will be treated as multiples when it's contextually sensible to do so, e.g.,
          line-height:1.5;

          And also, when would I do img#imageborder or just #imageborder?

          Neither if you are using a class as implied in your post above. Then it
          would be img.imageborder.

          But you must remove the border="1" from your HTML since it will override any
          CSS.


          --
          Murray --- ICQ 71997575
          Adobe Community Expert
          (If you *MUST* email me, don't LAUGH when you do so!)
          ==================
          http://www.dreamweavermx-templates.com - Template Triage!
          http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
          http://www.dwfaq.com - DW FAQs, Tutorials & Resources
          http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
          ==================


          "firmana" <webforumsuser@macromedia.com> wrote in message
          news:ehigmm$n1h$1@forums.macromedia.com...
          > here is my code:
          >
          > <tr height="250">
          > <td class="covercell"><img src="../images/noimage.gif" border="1">
          > </td>
          > <td class="covercell"><img src="../images/noimage.gif" border="1">
          > </td>
          > <td class="covercell"><img src="../images/noimage.gif" border="1">
          > </td>
          > </tr>
          >
          > the table code is in there but this is just one of the rows. I have
          > #covercell
          > just to align the image to the center. I wanted to have .gif"
          > class="imageborder"> and then have a border of 1. I have marked the border
          > for
          > imageborder as 1px. Do I need the px? And also, when would I do
          > img#imageborder
          > or just #imageborder? Thanks.
          >


          • 2. Re: Need help w/ CSS image border in table!
            firmana Level 1
            <tr>
            <td class="covercell"><img src="../images/noimage.gif" class="imageborder">
            </td>
            <td class="covercell"><img src="../images/noimage.gif" class="imageborder">
            </td>
            <td class="covercell"><img src="../images/noimage.gif" class="imageborder">
            </td>
            </tr>

            img.imageborder
            {
            border: 1px;
            }

            td.covercell
            {
            text-align: center;
            }



            Ok that is my new CSS and HTML. The borders still won't work. What is up?


            Also, I sitll have a quesiton. In general, when would I use say, table.alignment as opposed to .alignment (also with id's im curious about).
            • 3. Re: Need help w/ CSS image border in table!
              Level 7
              change:
              border: 1px;
              to:
              border: 1px solid #000;

              You need the three border attributes for it to work: border-width, border style, and border-color.

              firmana wrote:
              > <tr>
              > <td class="covercell"><img src="../images/noimage.gif" class="imageborder">
              > </td>
              > <td class="covercell"><img src="../images/noimage.gif" class="imageborder">
              > </td>
              > <td class="covercell"><img src="../images/noimage.gif" class="imageborder">
              > </td>
              > </tr>
              >
              > img.imageborder
              > {
              > border: 1px;
              > }
              >
              > td.covercell
              > {
              > text-align: center;
              > }
              >
              >
              >
              > Ok that is my new CSS and HTML. The borders still won't work. What is up?
              >
              >
              > Also, I sitll have a quesiton. In general, when would I use say,
              > table.alignment as opposed to .alignment (also with id's im curious about).
              >


              --
              seb ( ---@webtrans1.com)
              http://webtrans1.com | high-end web design
              Downloads: Slide Show, Directory Browser, Mailing List
              • 4. Re: Need help w/ CSS image border in table!
                firmana Level 1
                so when do you add html (like img) to something like .imageborder to make it img.imageborder? Sometimes I have those sometimes i dont
                • 5. Re: Need help w/ CSS image border in table!
                  Level 7
                  > Also, I sitll have a quesiton. In general, when would I use say,
                  > table.alignment as opposed to .alignment (also with id's im curious
                  > about).

                  You would use it in any of the following cases -

                  1. You have the class="alignment" applied to multiple elements on the page,
                  and you want this rule to ONLY apply to those elements that are within a
                  table having that class, e.g.,

                  this image -

                  <table class="alignment">
                  ...
                  <img...>
                  ...
                  </table>

                  not this one -

                  <table>
                  ...
                  <img...>
                  ...
                  </table>

                  (assuming that the details of the .alignment rule would only apply to
                  images)

                  2. You want this particular rule to have a higher priority than the simple
                  .alignment selector (adding additional context to the selector increases its
                  priority in the cascade).

                  I can't think of any others right now.


                  --
                  Murray --- ICQ 71997575
                  Adobe Community Expert
                  (If you *MUST* email me, don't LAUGH when you do so!)
                  ==================
                  http://www.dreamweavermx-templates.com - Template Triage!
                  http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                  http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                  http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
                  ==================


                  "firmana" <webforumsuser@macromedia.com> wrote in message
                  news:ehl3mi$2ck$1@forums.macromedia.com...
                  > <tr>
                  > <td class="covercell"><img src="../images/noimage.gif"
                  > class="imageborder">
                  > </td>
                  > <td class="covercell"><img src="../images/noimage.gif"
                  > class="imageborder">
                  > </td>
                  > <td class="covercell"><img src="../images/noimage.gif"
                  > class="imageborder">
                  > </td>
                  > </tr>
                  >
                  > img.imageborder
                  > {
                  > border: 1px;
                  > }
                  >
                  > td.covercell
                  > {
                  > text-align: center;
                  > }
                  >
                  >
                  >
                  > Ok that is my new CSS and HTML. The borders still won't work. What is up?
                  >
                  >
                  > Also, I sitll have a quesiton. In general, when would I use say,
                  > table.alignment as opposed to .alignment (also with id's im curious
                  > about).
                  >