I'm trying to override the disposal of the DetailView
widget by applying new css class but with no luck. I want all the records shown in the several instances of a DetailView
widget to appear side by side. I create a class in app\web\css
called detail1-view
and apply it to the detaiview.php
in vendor folder. The class has float:left
, or display:inline-block
in it, but none of the attributes work.
My Detailview is:
<?= DetailView::widget([
'model' => $model,
'attributes' => [
//'titulo',
'noticia',
// cria um array com a fotografia, em que
// carrega a path no campo fieldName da bd
[
'attribute'=>'fotodir',
'value'=>$model->fotodir,
'format' => ['image', ['width'=>'230','height'=>'200']],
],
],
]) ?>
and my detailview.php
in folder vendor/yiisoft/yii2/widgets/...
has in it the detail1-view
class in the right place:
public $options = ['class' => 'detail1-view'];
My CSS:
.detail1-view {
display: inline-block;
width: 30%;
border:1px solid #000;
}
The DetailView
continues to display one in top of another and not side by side.
Anybody has a solution for this issue ?