Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

archi_23's avatar

laravel barryvdh dompdf not getting css property in correct formart

I want to keep the question and mark property in same line. But in pdf, its showing in incorrect way.


          @foreach ($ques as $q)
          <div style="clear: both">
    <h5 style="margin-left: 100px;" style="float:left">{{$loop->iteration}}. {{$q->question}} </h5> <h5 style="float:right"> {{ $q->mark }} </h5>
    
          @endforeach

what can i do for that?

0 likes
3 replies
Snapey's avatar

first of all, you don't close the div that clears floats

Next, they can only be on the same line if there is room to sit side by side.

Does it layout correctly in the browser? What happens if you reduce the width?

archi_23's avatar

The div has end but i forgot to copy that part. Actually the problem is css float property not working for laravel dompdf. That's the problem.

Please or to participate in this conversation.