Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8213237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:02:55+00:00 2026-06-07T11:02:55+00:00

Border is not removing in the below code, which is image sprite . I

  • 0

Border is not removing in the below code, which is image sprite . I have tried some methods to remove the border using style and border 0 ,but no use .

<style>
img.home{width:40px;height:32px;
background:url(share.png) 0 0;
border-style: none;}
img.next{width:40px;
height:32px;background:url(share.png) -36px 0;
border-style:none;}
</style>
<a href="http://www.yahoo.com/">
<img class="home" border="0">
</a>
<img class="next" border="0"/>

JSFIDDLE

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T11:02:57+00:00Added an answer on June 7, 2026 at 11:02 am

    Images come with a default border, that only disappears when the image is downloaded. That image comes from the src attribute of the image. If no src is set, then the image won’t be downloaded, and the border will be forever there – your case exactly.

    A normal img tag looks like this:

    <img src="/something.jpg" />
    

    yours looks like this:

    <img />
    

    You’re adding your image through css’s background-image. Not as it should be done. You can add a background image, but it’s usually for other purposes. (check the aside at the bottom).

    Try removing the background image and placing the image location on the src attribute of the image. Like this:

    <img class="next" src="/share.png" />
    

    You’ll see the image has no border now.

    Aside
    When a background image is added to an img element, it’s usually to provide a placeholder image for when no img src is set. Think of avatars on the comments section of a blog.

    Also
    When creating a sprite, you can use divs ps ems etc. Remember, the background-image can be applied to any element!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've tried to set the margin and border to 0,but still not working. <style
How can I set label's border which is dynamically generated (Not from Interface Builder)?
Is it possible to add a border style to a UITableView? Not just bordercolor
<style> border-radius:10px; </style> <div class='radius'> <?= echo $score . 'score';?></div> It is not working
I have been trying to create a HTML E-mail, which is just one image
I am using Vaadin to create my front-end and when i add the border-style:solid
The HTML code below consistently results in TEXT A and TEXTB not being horizontally
For some reason the bottom-border would not display at the bottom? The border line
I have the following : <table style=border:solid 1px; border-color:black> <thead style=border:solid 2px; border-color:black> <tr>
I have difficulty in removing border from a specific PrimeFaces <p:panelGrid> . <p:panelGrid styleClass=companyHeaderGrid>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.