Results 1 to 8 of 8

Thread: Social Icon CSS Issue

  1. #1
    Join Date
    Sep 2007
    Posts
    172
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default Social Icon CSS Issue

    I have created some social icons using CSS, you can look the preview:

    THE QUESTION IS: How to add more icons next to it? I tried using CSS but I couldn't do it! Someone please help?



    HTML:

    <div class="social-share-buttons">
    <div class="clearbox">
    <div class="tweet"><div class="tweetmeme_button" style="margin:0px; padding:0px"><script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
    <a href="http://twitter.com/share" class="twitter-share-button"
    data-url="<?php the_permalink(); ?>"
    data-via="InTechBB #intechbb"
    data-text="<?php the_title(); ?>"
    data-related="BBilal:Founder of InTechBB"
    data-count="vertical">Tweet</a></div></div>
    <div class="facebook"><?php dd_fblike_generate('Like Box Count') ?></div>
    </div></div>

    CSS:

    /* Social share buttons */
    .social-share-buttons {float: right; margin-left: 16px; margin-top: 6px; }
    .clearbox{clear:both}
    .tweet{ margin-left: 60px; margin-top: 0; padding-bottom: 0; margin-bottom: -60px; }
    .facebook {position: relative; float: left;}

  2. #2
    Join Date
    Sep 2007
    Posts
    172
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    No one? Someone please help! I'm desperate about it!

  3. #3
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    I'm not sure what you mean by 'How to add more icons next to it?'

    Can you produce a screen cap mock-up of your desired outcome so we can understand more clearly?
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  4. #4
    Join Date
    Sep 2007
    Posts
    172
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    This is what I want actually.


  5. #5
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    OK - is that a screen cap from an actual site or an image mock-up?

    If its a screen cap from somebody elses site you should be able to check their HTML and CSS to see how they've done it.

    Otherwise it just looks like a series of div floats: http://css.maxdesign.com.au/floatutorial/
    Last edited by Beverleyh; 06-06-2011 at 01:01 PM.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  6. #6
    Join Date
    Sep 2007
    Posts
    172
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    oh so among all these div floats which one am I suppose to use to add one more?

  7. #7
    Join Date
    Sep 2007
    Posts
    172
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    Will it be like this

    /* Social share buttons */
    .social-share-buttons {float: right; margin-left: 16px; margin-top: 6px; }
    .clearbox{clear:both}
    .tweet{ margin-left: 60px; margin-top: 0; padding-bottom: 0; margin-bottom: -60px; }
    .facebook {position: relative; float: left;}
    .unnamed-socialicon {float:left;}

    ????

  8. #8
    Join Date
    Jun 2011
    Posts
    2
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Yeah so I'm not sure what you are trying to do, but this effect can be achieved several ways. So to create an icon you want to use a link on an image of the icon or use a background image

    so these classes seem to be just containers that float:
    .tweet{ margin-left: 60px; margin-top: 0; padding-bottom: 0; margin-bottom: -60px; }
    .facebook {position: relative; float: left;}
    .unnamed-socialicon {float:left;}

    so inside each container you need to put the actual link or content that has the icon. here is some psuedo class

    With just images


    <div class="facebook">
    <a href="#"><img src="your-facebook-src.gif"></a>
    </div>

    <div class="tweet">
    <a href="#"><img src="your-twitter-src.gif"></a>
    </div>


    <div class="another-social">
    <a href="#"><img src="your-another-social-src.gif"></a>
    </div>

    With background images
    This is similar except the link is empty, there is a class on it and there u specify width height and background image that is your social button

    <div class="facebook">
    <a href="#" class="social-button-fb"></a>
    </div>

    <div class="tweet">
    <a href="#" class="social-button-tweet"></a>
    </div>


    <div class="another-social">
    <a href="#" class="social-button-whatever"></a>
    </div>

    I won't do all of them, but each social buttons needs something like this:

    .social-button-facebook {
    display:inline-block;
    width:20px;
    height:20px;
    background:url(your-facebook-src.gif) no-repeat top left;
    }

    Hope this helps, but yes as Beverly H says right now all you seem to have are empty containers that float and don't do much else.

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
  •