www.webdeveloper.com
Results 1 to 3 of 3

Thread: made graphics image wont resize in css or html

Hybrid View

  1. #1
    Join Date
    Apr 2012
    Posts
    110

    made graphics image wont resize in css or html

    Hi, I made a small image, its a photo which I cut in gimp graphics, and painted the background, but now it wont go to the correct size in the webeditor. Im trying to put it on a red rectangle which I made with css.
    I want it on the right side of the rectangle. It must fit the exact height of the rectangle. Its about a third of the size of the rectangle.
    this is the code: .imaget
    {
    position:absolute;
    background-image:url(../image/talia.png
    background-color:transparent;
    background-position:right-top;
    height:150px;
    width:130px;
    left:800px;
    top:1px;
    }

    Then the code I put in html is<div class="image">
    <img src="talia.png.jpg"></div>

    Ive tried putting the height and width in img src, but that doesnt work either.
    the height and width seems to have no effect, when I put it in. It just stays the same size as it was loaded into the webeditor.

  2. #2
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    1
    .imaget
    {
    position:absolute;
    background-image:url(../image/talia.png);
    background-color:transparent;
    background-position:right-top;
    height:150px;
    width:130px;
    left:800px;
    top:1px;
    }

    You did not close the brackets in the url - that could cause some problems.

  3. #3
    Join Date
    Feb 2012
    Location
    Bokaro Steel City (Jharkhand), India!
    Posts
    194
    Please learn CSS properly!
    HTML Code:
    <style>
    #my_rect {
        width: 400px;
        height: 150px;
        border: 5px solid red;
        
        background-image: url('../image/talia.png');
        background-position: right top;
        background-color: transparent;
        background-size: 130px 150px;
        background-repeat: no-repeat;
    }
    </style>
    
    <div id="my_rect"> Hello world! Am I visible? ... Ok! Bye! </div>
    >>> Do not hesitate to ask me what you don't understand in the above code!
    "It will never rain roses: when we want to have more roses, we must plant more roses." - George Eliot

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles