If my div container has this:
<div id="container"><img src...
I can style the image by this:
CSS
#container img{ ... }
For object tag
<div id="container"><object ...
How do I address it? I tried this:
CSS
#container object{ width: 100px; }
But it does not work.
Assume the I cant define "id" or "class" for the object tag
I am using tinymce to embed to youtube video. And the code will be rendered like this:
<div id="container">
...
<div id="content">
<p>
<object width="435" height="350" type="application/x-shockwave-flash" data="http://www.youtube.com/v/l9caxMr9RgY">
<param value="http://www.youtube.com/v/XXXXXX" name="src"></object>
</p>
</div>
</div>
An object tag can be styled using CSS. Ref link text
The reason width didn't work in your example is that its a HTML attribute only and not accessible with CSS (see list in link above).
I would recommend that you put the object into a wrapper div (give the object a width of 100%) and control the width of the wrapper div with css.
You already add size and width to the object style="width: 100px; height: 100px;"
Example
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With