I'm stuck on a problem that I thought should be straightforward, but dompdf refuses to make my pdf as I want it. I want a pdf that my end user should print out containing a list with users with their names and a line where they should sign. Something like this:
I'm trying to do it like this:
<style>
.lineContainer div {height: 30px;}
.nounderscore {border-bottom: 0px;float:left;}
.underscore {border-bottom: 1px solid #000; overflow: hidden;}
</style>
#foreach($users as $user)
<div class="lineContainer">
<div class="nounderscore">{{$user->name}}</div>
<div class="underscore"></div>
</div>
#endforeach
This works fine when rendered as html, but when I use it for a pdf file it ends up with my underline starting from the far left end of the page, so also the names are underlined. Any ideas how to do this in a way that works with dompdf?
<style>
li{
padding-bottom: 25px;
list-style: none;
}
.line{
padding-right: 15em;
margin: 0 1em;
border-bottom: 1px solid grey;
}
</style>
<ul>
#foreach($users as $user)
<li>{{$user->name}}<span class="line"></span></li>
#endforeach
</ul>
Answer preview for static data:
https://jsfiddle.net/wz1vpsnx/
Related
my html is
<div id="heading1">
<ul class="heading">
<li>Geelong</li>
</ul>
</div>
and css is
.heading {
font-size: 24px;
text-align: center;
list-style-image: url('img/stationary/marker.png');
}
If I do the css inline it works but not otherwise.
With that code:
<div id="heading1">
<ul class="heading">
<li>Geelong</li>
</ul>
</div>
.heading{
font-size: 24px;
text-align: center;
list-style-image: url('https://www.google.fr/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png');
}
The list is displaying correctly with Google logo as bullet.
It seems that your problem is the image's URL that is wrong. You may verify that it points to an image that exists (think that it's a relative link)
How can I link image from background in css to some url (#player/deposit/) and leave amount to be linked to other url (player/wallet/)?
<div class="player-credit-info">
<a href="#player/wallet/">
<div class="player-credit-amount">
<div id="playerBalance">10000$</div>
</div>
</a>
</div>
Here is the css:
.player-credit-info {
padding: 0px 15px 0px 50px;
display: inline-block;
background: url(../images-vm/coin#2x.png) no-repeat;
background-size: 25px 22px;
background-position-x: 15px;
background-position-y: 2px;
float: right;
margin-top: 8px;
font-size: 18px;
}
I am not HTML programmer, but even it did not look complicate at first sight, I got stuck to keep both coin image and amount in the same line and to be linked to 2 different urls. I tried to exclude image in img tag, but did not get neat solution. Thank you for the help.
i am trying to build a responsive website using bootstrap and dreamweaver.
I would like to place an image in my navbar, and place a text link over the image. Im having some trouble getting the text to sit over the image.
Any help would be greatly appreciated.
Here is the source code:
</head>
<body>
<nav class="navbar navbar-fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="index.html">
<img src="files /button images/swirl 1 11.svg" alt="" width="130" class="d-inline-block align-top">
Tom
</a>
</nav>
Here is my own css sheet i linked to override bootstarps:
body{
background-color:#F00;
}
nav a{
font-size: 24px;
font-family: Arial, Helvetica, sans-serif;
color: #000;
background-color: transparent;
font-style: normal;
}
In that case, you need to add a bit of custom css like so:
.navbar-brand {
background: url("https://placeimg.com/130/40/animals") no-repeat center;
background-size: cover;
min-width: 130px;
}
Replace that with your SVG and you should be good to go.
That creates a background image for the element with the navbar-brand class.
For some odd reason I added a responsive image to my responsive layout and it seems to add some sort of spacing below the image.
You may view the issue here: http://www.client.noxinnovations.com/jensenblair/
The top image. Here is my HTML and CSS.
HTML
<div class="header"> <img src="images/photograph.jpg" /> </div>
CSS
img {
max-width: 100%;
height: auto !important;
}
.header {
height: auto;
padding: 0;
margin: 0 auto;
border: none;
}
It seems to be consistent in each browser. Any ideas anyone?
There are two ways (that I know of) to solve this: http://jsfiddle.net/3kC4K/1/
<div>
<img src="http://placehold.it/100x100/"/>
</div>
<div>
<img src="http://placehold.it/100x100/" class="block"/>
</div>
<div>
<img src="http://placehold.it/100x100/" class="inline"/>
</div>
CSS
div{
border:solid 1px #f00;
margin:5px;
float:left;
}
.block{
display:block;
}
.inline{
vertical-align:bottom;
}
img tags, by default, are inline elements. Because of this, browsers will create a sort of "gutter" underneath them so that any text that wraps below it won't be flush with the bottom of the image.
In your case, simply applying display:block to the image should do the trick.
This works fine in Webkit, but when I go to Firefox (Or IE8) it totally messed up. I've been staring at this for so long that I can't find any errors at all with it, so maybe one of you guys can point out where I'm going wrong.
CSS:
body {
font-family: Georgia, serif;
margin: 0px;
padding: 0px;
background: #222;
}
header {
background: #fff url('images/header-border.gif') bottom repeat-x;
width: 980px;
margin: 0px auto;
height: 100px;
padding: 0px 0px 0px 20px;
-moz-border-radius-topright: 4px; -moz-border-radius-topleft: 4px;
-webkit-border-top-right-radius: 4px; -webkit-border-top-left-radius: 4px;
border-top-right-radius: 4px; border-top-left-radius: 4px;
}
section {
}
article {
}
footer {
clear: left;
}
nav {
width: 980px;
margin: 0px auto;
height: 70px;
padding: 10px 0px 10px 0px;
font-size: 21px;
font-weight: bold;
font-family: Arial, serif;
}
nav a {
color: #fff;
text-decoration: none;
padding: 10px;
}
nav a:hover {
background: #060606;
}
#content {
width: 980px;
background: #fff;
padding: 0px 0px 0px 20px;
margin: 0px auto;
}
nav ul li {
float: left;
list-style: none;
width: 155px;
}
#left-column, #logo {
width: 560px;
margin: 0px auto;
float: left;
}
#right-column, #share {
width: 380px;
margin: 0px auto;
float: left;
height: 100%;
padding: 0px 0px 0px 20px;
border-left: 1px solid #d9d9d9;
}
address {
display: inline;
}
a img {
border: 0px;
}
.clear-left {
clear: left;
}
And the HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="text/html; charset=UTF-8" />
<title>Webtint </title>
<link rel="stylesheet" href="http://localhost/wp-content/themes/clean/style.css" type="text/css" />
<link rel="pingback" href="http://localhost/xmlrpc.php" />
</head>
<body>
<nav>
<ul>
<li>home</li>
<li>tutorials <img src="http://localhost/wp-content/themes/clean/images/arrow.gif" alt="Arrow" /></li>
<li>resources <img src="http://localhost/wp-content/themes/clean/images/arrow.gif" alt="Arrow" /></li>
<li>articles <img src="http://localhost/wp-content/themes/clean/images/arrow.gif" alt="Arrow" /></li>
<li>contact</li>
<li>follow us</li>
</ul>
</nav>
<header>
<section id="logo">
</section>
<section id="share">
</section>
</header>
<div id="content">
<section id="left-column">
<article>
<h2>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
<?php the_title(); ?>
</a>
</h2>
<time><?php the_time('F jS, Y') ?></time> by <address><?php the_author(); ?></address>
<?php the_excerpt(); ?>
<br /><br />
Read More
<?php comments_popup_link(
'<span class="boxed">No Responses »</span>',
'<span class="boxed"> 1 Response »</span>',
'<span class="boxed">% Responses »</span>'); ?>
</article>
<hr />
</section>
<section id="right-column">
<h2>Popular Posts</h2>
</section>
</div>
<footer>
</footer>
</body>
</html>
Screenshot in Firefox:
http://imgur.com/wvhI0.gif
Screenshot in Chrome: (How it's supposed to look)
http://imgur.com/sQK8S.gif
Screenshot in IE8:
http://imgur.com/7OnEJ.gif
Thanks for any help in advance :)
Basically, you're using mostly HTML5 specific elements, and they're not supported everywhere properly yet, especially IE8 out of those you listed.
For a quick look, Here's the list of elements added in HTML5.
Try using a debug tool like Firebug or the IE developer toolbar to figure out which elements are being placed wrongly and why.
Both let you hover your mouse over blocks and will highlight the corresponding HTML. You will be able to see exactly which element it is that is being placed incorrectly, and view the CSS to try and figure out why.
Johnny, does your solution also fix the incorrect rendering in Firefox 2 and Camino 1? Interesting, as I only know of the Javascript solution. Just to give you some more feedback on this: to learn more about getting HTML5 rendered properly in all major browsers, read this article by Nico Hagenburger. You can also use this script to render HTML5 in IE.
A more general article about HTML5 and CSS3 support in IE (e.g., your corners aren't rounded) in this article. For rounded corners in all major browsers (also in Opera) please read this one. There also exist general tables about support in all major browsers of HTML5 and CSS3.
EDIT: I just read an article about HTML5 pages not rendered properly when printing from within IE, because this JavaScript solution isn't loaded when printing a page. More info on doctype.com.