#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Location
    Horsham - England
    Posts
    302
    Rep Power
    33

    Referencing img object


    Hi all,

    I have come across this twice now within a new site I am building. I can not seem to be able to reference the img objects if they are within divs or other objects:

    page excert
    PHP Code:
    <ul Class="rsslink">

                         <
    li>Raw RSS Feed: <a href="feed.xml"><img src="images/rss.gif" alt="RSS Feed" border=none/></a></li>

                         <
    li>Google: <a href="http://fusion.google.com/add?feedurl=http://www.houseofhawkins.com/feed.xml">
                        <
    img src="images/googlerss.gif" alt="Google RSS Application" /></a></li>

                         <
    li>Yahoo: <a href="http://add.my.yahoo.com/rss?url=http://www.houseofhawkins.com/feed.xml">
                        <
    img src="images/yahoorss.gif" alt="Yahoo RSS Application" /></a></li>

                        </
    ul
    CSS excert

    PHP Code:

    ul 
    .rsslink  li img {
        
    border=none;
        
    margin-left50px;

    I have attached the full page and the full CSS if that helps (didnt want to post ALL that looks messy.

    Thanks for your help
  2. #2
  3. |<.+#f@#+.&.|
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2002
    Location
    norway
    Posts
    2,999
    Rep Power
    1228
    You just have a space too much.

    Code:
     ul.rsslink li img {
        border=none;
        margin-left: 50px;
    }
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Location
    Horsham - England
    Posts
    302
    Rep Power
    33
    thank you. I didn't realize it would be space sensitive
  6. #4
  7. |<.+#f@#+.&.|
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2002
    Location
    norway
    Posts
    2,999
    Rep Power
    1228
    The space changes the target. With the space you target an img-element within a li that is some child of an element with the class rsslink which again is a child of an ul.

    The hypothetical code could look something like:
    Code:
    <ul> 
       <li>
          <ol class="rsslink">
              <li><img /></li>
               ...
    I just saw that you have a typo in the css it should be border:none; not border=none;,
    or even better use border:0 none; (for accommodate some browser differences.)

IMN logo majestic logo threadwatch logo seochat tools logo