How to apply icons to links using css?


Tags: css

Problem :

i was wondering how can i add images to links with css that is compatible across FF, IE and Opera browsers?



Solution :

Set the background to your link icon and the padding to the width of your icon.

a { 
   padding-left: 10px;
   background: transparent url(link_icon.png) no-repeat center left;
}

    CSS Howto..

    How do i make liteAccordion (horizontal accordion plugin for jQuery) work in IE6

    How to do auto slide for divs [closed]

    CSS - How to set gradient color background for different heights

    How to define the color of characters in OL/LI lists via CSS, WITHOUT using any image bullets or any span tag?

    How to write many functions in one JS function

    How to make jQuery show() stay on page

    Show specific comment in LESS file when compiled to CSS while keeping all other comments hidden

    How to write css for alt attribute of img tag (word-break: break-all property doesn't work in IE)

    How do you create tabstops in XHTML?

    How to add custom css in Cognos?

    Why Does the

    tag creates a black background here? and how do I get rid from the border?

    How to unbind element then allow that element to bind again

    CSS How to add content under fixed position navbar [closed]

    How to horizontally center text in bootstrap button?

    Border positioning: how to?

    How to call am (image) div inside of a list?

    How to apply a css rule based on the number of siblings an element has? [duplicate]

    Yahoo's new blur effect in web mail - How?

    how to make the position of div is fixed even though it's empty?

    how to create circle that cut off one piece with css

    How to make a big image not scroll?

    How to use a JQuery Show/Hide script, to show hidden text

    How to make text labels stick next to an image in CSS?

    How to reduce space between unordered list and its previous element(center)?

    How to add multiple css rules at once through Dev-Tools or Firebug

    How to set Safari print margins via CSS to print borderless

    How to get a frame off animated png using CSS?

    How to show div of google maps after hidding it

    How to apply icons to links using css?

    How to align an absolute DIV of unknown height outside a “relative” parent by CSS?