How to use non-online images in CSS?


Tags: html,css,image

Problem :

How do I use a non online picture (no www.sth.com/image) in my HTML (or in CSS) site?

Normally when I use a picture I do <img src="link of image"> but how do I use a picture that I have locally on my computer?



Solution :

If, for example, your image is in the directory images/image.png, relative to the HTML file

You would use <img src="images/image.png" />. This will work both online and locally.


    CSS Howto..

    How to make a table-cell have the same width as its height?

    How to control the text inside DIV tag by not allowing the text to be increased?

    How can I select an nth element without knowing the element in CSS?

    How to trigger hasLayout on this li for IE 7 white space bug

    Trying to find the width of hidden content in order to resize the containing div to show the content (jQuery)

    Sencha Touch 2 date picker component & css: how to display hidden column names?

    How to load CSS in specific page in php

    CSS: How can I set image size relative to parent height?

    How can CSS interfere with JavaScript?

    how to create a fullscreen website design?

    How to align icons in a form using flexbox / css in a responsive way

    How to set url of fonts in css file into mvc project?

    How to make a block element adjust to the size of what is inside it?

    How do I add a dropdown menu to my css menu?

    How do I replicate this website in terms of responsiveness using only css?

    Website layout moving slightly between pages - how to stop it

    How can I highlight position in nav bar for single-page website?

    HTML/CSS: How can I float the 'a href' elements to the left without them leaving the div element that they are inside in?

    How to handle an id tag with '.' in CSS

    How to make a transparent border using CSS?

    CSS: How to float 3 divs side by side for width:100% without messing up?

    How does the DiggBar work?

    How to change the color of an active h5 tab using jQuery or CSS

    CSS: How to create a button with an arrow placedo on the right

    How to resize the width of div left to another which has float:left;?

    How to make my a scalable website with auto:height and overflow:auto

    How to position a div differently for a specific page?

    How to shorten blockquote to wrap around floated div?

    how do i include css based on screen size of the device

    How to change URL inside CSS?