PDA

View Full Version : There doesn't seem to bee a css rule for the object tag



nikos101
Dec 22nd, 2008, 01:08 PM
There doesn't seem to bee a css rule for the object tag, how do we get round this, wrap it in a div?

abduraooft
Dec 22nd, 2008, 02:09 PM
I think wrapping would be the best cross browser solution.

VIPStephan
Dec 22nd, 2008, 02:12 PM
What? You can style an object, too, but it’s limited. An object element is an inline element by default, I think, so you may need to make it display as block in order to apply further styling.



object {
border: 1px solid red; /* works by default */
display: block;
margin: 10px 20px;
}


However, since you didn’t specify what you wanna do I can’t tell you exactly how you should approach it.

nikos101
Dec 22nd, 2008, 03:02 PM
I just wanted this style for the object:


w500{
width:500;
}
.centered{
margin: 0px auto;
text-align:center;
}

abduraooft
Dec 22nd, 2008, 03:05 PM
Have you checked

object{
display:block;
margin: 0px auto;
text-align:center;
width:500px;
} ?

Apostropartheid
Dec 22nd, 2008, 03:10 PM
I just wanted this style for the object:


w500{
width:500;
}
.centered{
margin: 0px auto;
text-align:center;
}
w500 is not an element.
width requires a unit of measurement.