Change the size of picture ( CSS )

4 replies
Hello,
I want to change size of this picture I want to The entire show.


#change #css #picture #size
  • Profile picture of the author Lokki08
    Hey sayou20,

    I highly recommend you learning CSS and HTML. You can do so at W3Schools Online Web Tutorials. This is great website for newbies.

    You say you want to resize that image using css, well you have at least few options. One is to use properties width and height directly in that image, for example:

    <img src="/Images/my-image.png" width="XXX" height="XXX" />

    Here of course you would provide the size of image you want in properties 'width' and 'height'.

    Second option is using CSS. First you need to give class or id to that image and then in your xxxx.css file you need to give those 'width' and 'height' properties. Like this:

    Let say you have index.html where your image is located.

    <img src="/Images/my-image.png" id="my-image" /> (Giving id to that specific image)

    OR

    <img src="/Images/my-image.png" class="my-image-class" /> (Giving class name for that specific image)

    Now you can go to your .css file, let's say it is called main.css and we choose the class way of image, thus in your main.css you would write:

    .my-image-class {
    width: xxx;
    height: xxx;
    }

    Here you can specify the width and height as pixels, precents or em and other types.
    {{ DiscussionBoard.errors[10562834].message }}
  • Profile picture of the author deepCode
    Adding to Lokki's greate writeup:

    1. You can put the CSS code directly in style="" attributes if you only want to scale one picture on-the-fly

    2. If you give it width and height, the proportions of the image might get "****ed up", so it might be better to stick with one of it.
    Signature
    Artificial Intelligence meets content marketing

    >>> AI-Writer.com <<<


    You write the headline & our AI writes the article. (FREE while in alpha)

    {{ DiscussionBoard.errors[10562948].message }}
  • {{ DiscussionBoard.errors[10573921].message }}
  • Profile picture of the author zozoreview
    you can use :
    <img src='url' id='image'/>
    #image {
    width : xxx;
    height : xxx;
    }
    {{ DiscussionBoard.errors[10574793].message }}

Trending Topics