第 52 行中的 FatalErrorException:语法错误,意外 'height' (T_STRING)

FatalErrorException in line 52: syntax error, unexpected 'height' (T_STRING)

我正在尝试创建图像路线,也就是说,使用图像作为路线。这是我正在尝试创建的更新 link,但它一直出现此错误:

FatalErrorException in fdda73edfe1d1362826e9383e141e71a line 52:
syntax error, unexpected 'height' (T_STRING)

可能css的格式是它看不懂的地方。 这是代码:

{!! Html::linkRoute('updateUserContact', '<img style='height: 100%; width: 100%; object-fit: contain' src="' . asset('images/add.png') . '"/>', contacts->id) !!}

试试这个:

{!! Html::linkRoute('updateUserContact', '<img style="height: 100%; width: 100%; object-fit: contain" src="' . asset('images/add.png') . '"/>', contacts->id) !!}

您使用了单引号,string/parameter提前结束