Sorry for the stupid question, but I looked everywhere in the doc. If I want to set size, height and width of an image with HTML::image
, how can I do it?
I tried with:
{{ HTML::image('path', array('width' => 70 , 'height' => 70)); }}
But it doesn't seem to work.
container img { width: 100%; height: 400px; //this should be the same as the width value.. }
The purpose of the height (and the width attribute as well) is to inform the browser of the actual size of the image as it appears in the file — not as it is intended to appear in the design of the page.
It should work with
{{ HTML::image('path', 'alt', array( 'width' => 70, 'height' => 70 )) }}
The alt text comes before the attributes array.
In Laravel 5 following ways to use img in blade:
{!! HTML::image('img/picture.jpg', 'a picture', array('class' => 'thumb')) !!}
Note: you need to install laravel library before use HTM i.e "laravelcollective/html": "~5.0",
OR
<img src="{!!asset('img/picture.jpg')!!}">
OR
Set dynamically url:
<img src="{!!asset('img/').'/'.$imgsrc!!}">
Solution : store image path to your MYSQL table field. And dont forget the dot ( . ) at the beginning of filepath.
<img src='./images/bajja_huggy2.gif' class= img-responsive style= height: 22px; width: 100px; >
you can see how I have used twitter bootstrap and other properties.
@foreach($imagefiles as $img)
<div class="col-xs-2 ">
{{ $img->image_3}}
</div>
@endforeach
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