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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:48:13+00:00 2026-05-29T10:48:13+00:00

I have an odd situation which I’m trying to improve. I have HTML content

  • 0

I have an odd situation which I’m trying to improve. I have HTML content that displays fine on my web page, but not on others. I define a style in my page, which I apply to the <img> tag to limit its width, and it works great.

What I would like, though, is to have inline CSS on my <img> tag that basically says “hey, if that style I specified doesn’t exist, do this instead”. Is there any way to do that?

(for those who are curious, this is for content that can be republished elsewhere, and I have no control over the CSS on the other pages)

Update

Perfect, the !important rule was exactly what I needed. Thanks to everyone who answered.

  • 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-29T10:48:14+00:00Added an answer on May 29, 2026 at 10:48 am

    css:

    img {
        border: solid 2px red !important;
    }
    

    html:

    <img style="border: solid 2px blue;">
    

    the img border color will be red, unless the stylesheet is not present, when it will default to blue.

    See example: http://jsfiddle.net/GyR6N/

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

Sidebar

Related Questions

I have an odd situation in which I need to modify the position of
I have an awkward situation in which I have a 32-bit lib that must
I have recently came upon odd situation; HTML formatted text in my Swing components
I've got an odd situation. Basically, I have two custom bindings which are used
I have run into an odd situation. I'm writing a JavaScript bookmarklet that will
I have a rather odd situation. I'm trying to automate the backup of a
This is a bit of an odd situation. Here's what's happening. So, we have
I have an odd problem...I'm using a documentation generator which generates a lot of
I have an odd edge case right now in that a response code from
I have the odd problem that I am not able to open the properties

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.