-1

I have an image(Logo). This logo is bit larger than my required size. Is it possible to place this image in a specified size using css. The screen should be responsive so X and Y coordinates have to specified in percentage. Can this be done?

Madhan
  • 81
  • 1
  • 2
  • 7
  • 2
    you should read this article before posting question { http://stackoverflow.com/help/how-to-ask } – Roy Sonasish May 20 '15 at 10:41
  • Still wondering how your code might look! [Create Demo](http://www.jsfiddle.net) – divy3993 May 20 '15 at 10:49
  • You can specify either `width` or `height` in your css, in px or %, whatever you like. As long as you only specify one of them, the other will be automatically calculated by the browser to keep the aspect ratio. – connexo May 20 '15 at 11:24
  • @divy39931 how to share the code in fiddle here? – Madhan May 20 '15 at 11:25
  • is it possible to specify the image size? What is the code to achieve this in css – Madhan May 20 '15 at 12:04
  • post your code here. so that we can see what you really mean. – Elle May 21 '15 at 02:34

1 Answers1

1

Set the image

img {
    width: 100%;
}

It will occupied the whole container size. The height will be set automatically to save the original width/height ratio.

Visit this question: Make an image responsive - simplest way

Community
  • 1
  • 1
Amos N.
  • 627
  • 10
  • 16