Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Styling not applied to PDF #325

Closed
109digital opened this issue Mar 2, 2017 · 4 comments
Closed

Styling not applied to PDF #325

109digital opened this issue Mar 2, 2017 · 4 comments

Comments

@109digital
Copy link

109digital commented Mar 2, 2017

Hello, we're using this with Laravel 5.2.

PDF creation is working beautifully, but styles aren't being applied.

Here's how we're creating the PDF: PDF::loadHTML($contract)->save($user_directory."/".$pdf_file);

$contract = '
		<style>
			.text-center {text-align: center;}
			.fw600 {font-weight: 600;}
			.mb8 {margin-bottom: 8px;}
			.default-list-upper-alpha {
				list-style-type: upper-alpha;
				list-style-position: inside;
				margin-left: 8px;
			}			
		</style>
			<h4 class="text-center fw600">
				WEBSITE DESIGN AGREEMENT
			</h3>
			<p>
		This Agreement is made and entered into by and between ' ...

In the generated PDF, our styling is being ignored.

Any ideas?

@109digital
Copy link
Author

Solved: Needed to use <style type="text/css" media="all"> rather than <style>.

@nomi-techie
Copy link

Yes, That was the only reason. I got same issue and solved using type="text/css" media="all" in style tag. Thankyou.

@dragipostolovski
Copy link

It works. Thank you @109digital .

@Wilsonabdiel
Copy link

I'm having an issue with this but not all of my styles are responding. Please Is there a specific way I need to write the css?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants