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 6672031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:27:37+00:00 2026-05-26T03:27:37+00:00

If I have the choice to insert images directly into the html or in

  • 0

If I have the choice to insert images directly into the html or in the css, say for example a link wrapped in an image I could do either…

<a href="#"><img src="#" alt="" width="" height="" /></a>

Or I could do…

<a id="img" href="#"></a>

#img {background: url('#') no-repeat; height: #; width: #;}

Which is better and why? Both work as wanted but is there any difference to load times etc, or any considered better practice?

  • 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-05-26T03:27:38+00:00Added an answer on May 26, 2026 at 3:27 am

    Using images in HTML is better when the image has any contextual meaning… if it is a decorative picture without any contextual meaning, then use CSS. CSS is for presentation, HTML is for content.

    The best hint for you to determine whether to use HTML or CSS for a picture is:
    If I remove the picture, will the web-page content still make sense?

    An image in HTML is meant to provide a visual meaning in context, with a meaningful text fall-back. Using an A element without any content should be avoided since its content will have a relationship with the link, for browsers and web-crawlers (such a Google bot).

    Use CSS images only for decorative purposes. Otherwise it can damage your search engine rankings. Always provide an alt attribute for images, determine what will it be imagining that an eventual visitor cannot see any images.

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

Sidebar

Related Questions

Is it a good choice to have unverified users into the users_table or should
I have like 10 table inserts and each insert has 1 either 1000 or
How can I insert text to a row of my choice ? I have
I have an input form that allows me to insert a new quiz into
Let's say I have some text, with a (more)... link at the end of
I have a choice. I have a number of already ordered strings that I
I would like to have the choice in a variable_load function (as used to
I'm updating my code generator and have a choice between implementing a method stub
I'm building an ajax application and I have a choice to make on how
In general, If I have a choice when developing a web site to use

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.