CSS help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mutt
    Too lazy to set a custom title
    • Sep 2002
    • 34431

    #1

    CSS help

    fuck CSS, all i'm trying to do is add some link text to the right of these icons and no matter what I try the link text ends up going under the icons on a new line.

    how can i get the text to the right of the icons?

    Code:
     <ul>
                        <li><a href="#."><img src="images/facebook.png" alt="" /></a></li>
                         <li><a href="#."><img src="images/linkedin.png" alt="" /></a></li>
                          <li><a href="#."><img src="images/twitter.png" alt="" /></a></li>
                        </ul>
    I moved my sites to Vacares Hosting. I've saved money, my hair is thicker, lost some weight too! Thanks Sly!
  • fris
    Too lazy to set a custom title
    • Aug 2002
    • 55679

    #2
    i would do it a different way.

    example

    Code:
    html example
    
    <div id="footer">
        <ul>
    		<li><a href="http://www.gfy.com/feed/" class="feed" title="Subscribe to the GFY feed">Feed</a></li>	
        </ul>
    </div>
    
    css for this
    
    #footer ul li a {
        display: block;
        float: left;
        padding: 3px 15px 3px 12px;
        color: #999;
        text-decoration: none;
    }
    
    #footer ul li a.feed {
        background: url(images/icon_feed.gif) 0 60% no-repeat;
    }
    
    #footer ul li a:hover {
        color: #4E677A;
        text-decoration: underline;
    }
    of course you would have to take into consideration the size of your icon.
    Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

    Comment

    • Mutt
      Too lazy to set a custom title
      • Sep 2002
      • 34431

      #3
      Originally posted by fris
      i would do it a different way.

      example

      Code:
      html example
      
      <div id="footer">
          <ul>
      		<li><a href="http://www.gfy.com/feed/" class="feed" title="Subscribe to the GFY feed">Feed</a></li>	
          </ul>
      </div>
      
      css for this
      
      #footer ul li a {
          display: block;
          float: left;
          padding: 3px 15px 3px 12px;
          color: #999;
          text-decoration: none;
      }
      
      #footer ul li a.feed {
          background: url(images/icon_feed.gif) 0 60% no-repeat;
      }
      
      #footer ul li a:hover {
          color: #4E677A;
          text-decoration: underline;
      }
      of course you would have to take into consideration the size of your icon.
      thanks, gonna add the float left
      I moved my sites to Vacares Hosting. I've saved money, my hair is thicker, lost some weight too! Thanks Sly!

      Comment

      • grumpy
        Too lazy to set a custom title
        • Jan 2002
        • 9870

        #4
        <li><NOBR><a href="#."><img src="images/facebook.png" alt="" /></a></li>

        or set in css white-space: nowrap;
        Don't let greediness blur your vision | You gotta let some shit slide
        icq - 441-456-888

        Comment

        • fris
          Too lazy to set a custom title
          • Aug 2002
          • 55679

          #5
          Originally posted by Mutt
          thanks, gonna add the float left
          http://jsfiddle.net/r2HY3/

          here is a live example of this.
          Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

          Comment

          • redwhiteandblue
            Bollocks
            • Jun 2007
            • 2793

            #6
            Try

            li a img {display:inline;}
            Interserver unmanaged AMD Ryzen servers from $73.00

            Comment

            • Mutt
              Too lazy to set a custom title
              • Sep 2002
              • 34431

              #7
              dumb me - the <li>'s had a width that was too small to fit the text in one line

              thanks for the CSS tips
              I moved my sites to Vacares Hosting. I've saved money, my hair is thicker, lost some weight too! Thanks Sly!

              Comment

              Working...