Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How can I reference an Img in a Script?

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #42847
    Tensville
    Member

    Hello. I have gotten an ad script to work on my blog site, but I need to change the image size.
    I have been using the same script for a month now and usually when I need to do this I go to PS and change them manually, however I was wondering if I could set the size with CSS?
    Here is a link to my blog:
    http://random.therandy.tk/

    #125245
    chrisburton
    Participant

    .widget-content img {
    max-width: 100%;
    }

    #125247
    tomrogers123
    Member

    Couldn’t you set the image dimensions in JavaScript when loading the ad (via `element.width = `) using the name of `adBanner` to select it or am I missing something?

    #125248
    Tensville
    Member

    Hmm I haven’t changed the widths of the images, but I did move it over, by putting a div style.
    How does it look(and load)?

    #125250
    TheDoc
    Member

    @chrisburton has the answer for doing it via CSS (though I’d also put `height: auto;`).

    But @tomrogers123 is getting a little closer to the real problem, I think. If you’re using a service to display the ads, you should be able to tell it what size to deliver the ads in.

    #125252
    Tensville
    Member

    Scratch that.
    It all works fine now.
    I found that just moving the ad over works for me as far as the site is concerned.
    Thank you all for your help.

    #125257
    chrisburton
    Participant

    @Tensville Moving it over sort of breaks the whole appearance of the layout. It doesn’t look as appealing if you’d actually scale it down to fit the area.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.