Force banner to have specific width and height

how can i force a banner contained in the following code:

<script type=“text/javascript” src=“http://sdasdasdsasasdsdsccccc;cre=mu;js=y;target=_blank”></script>

to have a specific width and height?

i tried by putting it into a div, but still the banner keeps its original sizes

Perhaps having it in a div but do something like, to over ride the image.


#ad_code img { width: 400px; height: 100px }

@acqua: To me, it’s not really clear what you mean by “a banner contained in the following code”. Contained in what way?

i have this ad banner ok?
<script type=“text/javascript” src=“http://sdasdasdsasasdsdsccccc;cre=mu;js=y;target=_blank”></script>
and the normal size would be 300x250

but my needs is to resize it to 200x200 so i need the div to “force” its widht and height, if possible

That’s not an ad banner. It’s a line of JavaScript. :slight_smile:

Ok it is a JS and it calls a banner
Is it possible to set the width and height of the JS?

No, the JS just pulls in the banner and then gets out of the way. So you need to set the size of the banner. We’d need to see the code that is pulled in to suggest how to target it with CSS.

you mean you want to see the code?
it’s more or less like the one i originally posted

Not the link to the JS file, but the actual HTML that is pulled in by that link. It will probably be a series of divs, perhaps an iframe etc. that contains all the content of the banner.

Are you able to link to the site? That would be the easiest option.

all i have is this code to put in the page where i need to show the banner:



<script type="text/javascript" src="http://fdssddfsddfsdf.eu/eas?cu=14940;cre=mu;js=y;target=_blank"></script>

and this other to put in the header code


<script type="text/javascript" language="JavaScript" src="http://fdssddfsddfsdf.eu/EAS_tag.1.0.js"></script>

OK, then we’d need to see the site to look at the code, or you can use the web inspector (right click on the banner in Chrome and choose Inspect Element) to see the code that is pulled in by that link.

Hm, doesn’t seem to be easy to manipulate the code much, but you could do something simple like add this to your CSS to make it look a bit better:

ins {
  width: 100% !important;
  background: black;
}

Can u suggest inline css pls?

No, you can’t do it inline, because you don’t have access to the code. All you could do is put it in the head of your page like this:


<style>
ins {
  width: 100% !important;
  background: black;
}
</style>

I put the code in <div class=“adv”>

and recall the class in the header:

<style>
adv {
width: 100% !important;
background: black;
}
</style>

but the banner still show in the un-wanted size

You forgot the dot before “adv”

[COLOR="#FF0000"].[/COLOR]adv {
width: 100% !important;
background: black;
}

the problem now is the height change but width doesn’t :frowning:

You’ve set it to a width of 1px and a height of 10px

.adv {
width: 1px !important;
height: 10px !important;
background: black;
}

What are you actually trying to do here? Do you want to get rid of it altogether?

i simply want to force the banner to have:
width: 10px
height 10px

And are you saying that it doesn’t work, even after changing width: 1px !important; (which is apparently what you have) to width: 10px !important; ?