How can I remove the border around an image without a source?


Tags: html,css

Problem :

I have an image, and I haven't defined the source yet. It has a border :/

eg: <img src="" />

If I give it a source, the border goes away (due to the css: border:none).

How can I remove the border around an image when it doesn't have a source?



Solution :

You can't it is a default from the browser, best to just add in the src or not have the image tag, or set its width/height to 0 unless there is a src available. You could also use a transparent image as a placeholder as well.


    CSS Howto..

    How can I style a button to look the same as the home button in Google Chrome with CSS? [closed]

    How to indent list items using CSS when you have floating blocks?

    How to override inline css through javascript?

    CSS - How to force elements to 100% of remaining/available space of parent element without extending beyond it?

    Pure JavaScript - how to add class to a class? Or change style in class

    CSS: How to accomplish a div which is blurred at the edges?

    How to target last row in a list with CSS?

    How do I take multiple CSS files with the exact same selectors and force one to be used only on a specific div?

    How do I add an attribute to a specific CSS class?

    How to get just one parameter in 'clip' CSS property using JQuery? [duplicate]

    How to position a background image like wanderfly.com?

    parse JSON to HTML table: How do I format the css of the table?

    How to get the CSS width of a mobile device in ASP.NET MVC?

    How to set css class on active menu item using a masterpage?

    How to apply background color (or custom css class) to column in grid - ExtJs 4?

    How to get the system accent color for UWP-Apps?

    How to display inline with rails?

    CSS three inline elements with align from left to right, how to occupy all available width

    How to make an entire square div clickable with CSS?

    What is the best way to store css data inside database and call it similar to how a css file would be

    How to use CSS with JS [duplicate]

    how to remove margin or padding of window in javascript/css?

    How to make a disabled select box look like a normal text box(css only)

    How can I load css file in Meteor for just one page?

    How to morph multi-part css properties with Mootools Fx?

    How to repeat nth-child rules for an infinite sequence in CSS

    How can I make a fixed background image not stay fixed on scroll?

    How to restrict zoom of webpage to stretch when iPhone and Android in landscape orientation?

    How to style HTML5 input type=“datetime-local” [duplicate]

    how to make div static in css