Facebook Like box not expanding container div - css

I have just copied the code for a Facebook Like box into a new site design I am building but when it loads it's not expanding the containing div.
Also I've noticed that it will disappear sometimes and the page needs to be refreshed to bring it back.
What is causing it not to expand the div. I thought it was to do with a float but can't see one that will affect it.
I've attached the xhtml/css
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#">
<head>
<title></title>
<link href="css/styles.css" rel="stylesheet" type="text/css" media="screen" />
<link href='http://fonts.googleapis.com/css?family=Anton|Oswald' rel='stylesheet' type='text/css'>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>
</head>
<body>
<div id="container">
<div class="body">
<div class="body_bottom">
<div class="body_top">
<div id="header">
<img src="images/banner.jpg" />
</div>
<div id="content">
</div>
<div id="sidebar">
<div class="sidebar_item">
<div class="sidebar_item_top"></div>
<div class="sidebar_item_pad">
<p>Get updates for our latest news, events and blogs.</p>
<form id="addressform" action="/" method="get">
<div class="textl1"><label id="namLbl" for="mlName">Name</label><input type="text" id="mlName" name="mlName" /></div>
<div class="textl1"><label id="emlLbl" for="mlEmail">Email</label><input type="text" id="mlEmail" name="mlEmail" /></div>
<div class="textr1"><input type="submit" id="mlbutton" name="mlbutton" value="" class="button-signup" /></div>
<p id="response" style="text-align: left"></p>
</form>
</div>
<div class="sidebar_item_bottom"></div>
</div>
<div class="sidebar_item">
<div class="sidebar_item_top"></div>
<div class="sidebar_item_pad">
<div id="fbook">
<div class="fb-like-box" data-href="https://www.facebook.com/FacebookDevelopers" data-width="292" data-show-faces="true" data-header="false" data-stream="false" data-show-border="false"></div>
<br style="clear:both">
</div>
<div id="fb-root"></div>
<script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "http://connect.facebook.net/en_GB/all.js#xfbml=1&appId=151487781542911";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
$(window).bind("load resize", function(){
var container_width = $('#fbook').width();
$('#fbook').html('<div class="fb-like-box" ' +
'data-href="https://www.facebook.com/adobegocreate"' +
' data-width="' + container_width + '" data-height="730" data-show-faces="true" ' +
'data-stream="false" data-header="false"></div>');
FB.XFBML.parse( );
});
</script>
</div>
<div class="sidebar_item_bottom"></div>
</div>
<div class="clearboth"></div>
</div>
</div>
</div>
<div id="footer">
</div>
</div>
</body>
</html>
and the css
body {
background: #f2f2f2;
}
#header {
}
#container {
width:1009px;
margin:20px auto;
}
#largeimage {
float:left;
width:943px;
margin: 10px 0 10px 8px;
}
#content {
float:left;
width:620px;
margin: 11px 19px 0 9px;
}
#sidebar {
float:left;
width:304px;
}
.clearboth {
clear:both;
}
#footer {
clear:both;
width: 962px;
height:208px;border-top:1px dotted #CCCCCC;padding:10px 0;background: #373737 url(../images/sniper_scope.jpg) no-repeat 15px 10px;
margin: 10px 22px;
}
.body {
background: url('../images/body_center.png') repeat-y;
width: 1009px;
}
.body_top {
background: url('../images/body_top.png') no-repeat;
width: 1009px;
padding: 0px 24px;
}
.body_bottom {
background: url('../images/body_bottom.png') no-repeat bottom;
width: 1009px;
}
.img_top {
background: url('../images/img_top.png') no-repeat;
height: 8px;
width: 943px;
}
.img_center {
background: url('../images/img_center.png') repeat-y;
width: 943px;
}
.img_pad {
margin: 2px 8px 2px;
}
.img_bottom {
background: url('../images/img_bottom.png') no-repeat;
height: 15px;
width: 943px;
}
#contentimg {
border: 1px solid #CECECE;
}
.content_item_top {
background: url('../images/content_item_top.jpg') no-repeat;
width: 623px;
}
.content_item {
width: 623px;
margin: 0 0 15px;
}
.content_item_main {
border: 1px solid #CECECE;
padding: 10px 22px;
}
.content_item_bottom {
background: url('../images/content_shadow.png') no-repeat;
height: 9px;
width: 623px;
}
.sidebar_item_top {
background: url('../images/sidebar_item_top.jpg') no-repeat;
height: 39px;
width: 304px;
}
.sidebar_item {
background: url('../images/sidebar_item_centre.jpg') repeat-y;
width: 304px;
margin: 0 0 15px;
}
.sidebar_item_pad {
margin: 5px 26px 12px;
}
.sidebar_item_bottom {
background: url('../images/sidebar_item_bottom.jpg') no-repeat;
height: 9px;
width: 304px;
}
ul.footerlist {
float:left;
list-style-type:none;
padding:20px 16px;
}
ul.footerlist li {
font-family: Verdana,Tahoma,Arial,Helvetica,sans-serif;
font-size:10px;
color: #373737;
}
#footer h5 {
font-size:120%;
color: #E5DFCA;
}
#footertop, #footerbottom {width:710px;float:right;}
#footerbottom p{font-size:11px;color:#f0f0f0;font-style:normal;font-weight:normal;margin:0;padding:0px;line-height:20px;text-align:left;}
#footertop a{color:#f0f0f0;text-decoration:none;}
#footertop a:hover{color:#c3c3c3;text-decoration:underline;}
h1, h2 {
margin:0;
/*font-family: 'Anton', sans-serif;*/
font-family: 'Oswald', sans-serif;
color: #1a1e1c;
}
p {
font-family: tahoma;
font-size: 10pt;
color: #424242;
line-height:20px;
}
#fbook {
}

Maybe try an overflow:auto on the container of the facebook embed? So put it on #fbook

Related

center several blocks (titre, texte, logo)

I would like to get this result below:
Example
My problem is that, I don't understand why my blocks are not centered correctly even with the propriety display: inline-block in my selector homebotblock1?
I tried this:
*{
margin:0;
padding:0;
}
.homebot{
background:url('https://zupimages.net/up/20/21/9zj3.jpg') no-repeat center;
background-size:cover;
background-attachment:fixed;
min-height:500px;
display:inline-block
width:100%;
}
.homebotbg{
background-color:rgba(255,255,255,0.7);
min-height:500px;
display:block;
width:43%;
float:right;
padding:100px 50px 50px 30px;
text-shadow:#fff 1px 1px 0px;
text-align:left;
}
.homebottit{
font-size:24pt;
font-family:roboto;color:#c22312;
text-transform:uppercase;
margin-bottom:50px;
display:inline-block;
}
.homebotpad{
padding-left:10px;
}
.homebottxt1{
font-size:16pt;
font-family:roboto;
color:#000;
}
.homebottxt2{
font-size:10pt;
font-family:open sans2;
color:#000;
}
.homebotblock1{
width:80px;
display:inline-block;
}
.homebotblock2{
width:450px;
display:inline-block;
}
<!Doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Titre de la page</title>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<body>
<div class="homebot">
<div class="homebotbg">
<span class="homebottit">Security Investment Solutions</span>
<img class="homebotblock1" src="https://zupimages.net/up/20/21/yljn.png" alt="img" />
<div class="homebottxt1">ADVANTAGEOUS CONDITIONS</div>
<div class="homebottxt2">We use your money to make a source of long-term profit. At the same time you become both our client and a shareholder.</div>
</div>
</div>
</body>
</html>
You need to wrap the homebottxt1 and homebottxt2 text in its own <div> then wrap that <div> and the image in another <div> with the class homebotblock3.
Then add this CSS:
.homebotblock3 {
display: flex;
}
.homebotblock3 > div {
margin-left: 20px;
}
Modified Code
JSFiddle: https://jsfiddle.net/Zeraora/gefhov6b/
* {
margin: 0;
padding: 0;
}
.homebot {
background: url('https://zupimages.net/up/20/21/9zj3.jpg') no-repeat center;
background-size: cover;
background-attachment: fixed;
min-height: 500px;
display: inline-block width:100%;
}
.homebotbg {
background-color: rgba(255, 255, 255, 0.7);
min-height: 500px;
display: block;
width: 43%;
float: right;
padding: 100px 50px 50px 30px;
text-shadow: #fff 1px 1px 0px;
text-align: left;
}
.homebottit {
font-size: 24pt;
font-family: roboto;
color: #c22312;
text-transform: uppercase;
margin-bottom: 50px;
display: inline-block;
}
.homebotpad {
padding-left: 10px;
}
.homebottxt1 {
font-size: 16pt;
font-family: roboto;
color: #000;
}
.homebottxt2 {
font-size: 10pt;
font-family: open sans2;
color: #000;
}
.homebotblock1 {
width: 80px;
display: inline-block;
}
.homebotblock2 {
width: 450px;
display: inline-block;
}
.homebotblock3 {
display: flex;
}
.homebotblock3>div {
margin-left: 20px;
}
<!Doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Titre de la page</title>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<body>
<div class="homebot">
<div class="homebotbg">
<span class="homebottit">Security Investment Solutions</span>
<div class="homebotblock3">
<img class="homebotblock1" src="https://zupimages.net/up/20/21/yljn.png" alt="img" />
<div>
<div class="homebottxt1">ADVANTAGEOUS CONDITIONS</div>
<div class="homebottxt2">We use your money to make a source of long-term profit. At the same time you become both our client and a shareholder.</div>
</div>
</div>
</div>
</div>
</body>
</html>
* {
box-sizing: border-box;
}
p {
margin: 0;
padding: 0;
}
.homebot{
background: url('https://zupimages.net/up/20/21/9zj3.jpg');
background-size: 100% auto;
background-position-x: center;
background-position-y: -100px;
height: 25vw;
display: block;
position: relative;
}
.homebotbg {
position: relative;
left: 40%;
width: 60%;
height: 100%;
background-color: rgba(255, 255, 255, .7);
padding: 10px 30px;
display: flex;
flex-direction: column;
align-content: flex-end;
}
.homebot-header {
flex-basis: 50%;
display: flex;
flex-direction: column;
justify-content: flex-end;
}
.homebottit {
color: red;
font-size: 24px;
}
.homebot-footer {
flex-basis: 50%;
display: flex;
align-items: center;
}
.homebotblock1 {
margin-right: 15px;
}
.homebottxt1 {
font-size: 18px;
margin-bottom: 5px;
}
<!Doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Titre de la page</title>
</head>
<body>
<div class="homebot">
<div class="homebotbg">
<div class="homebot-header">
<p class="homebottit">Security Investment Solutions</p>
</div>
<div class="homebot-footer">
<img class="homebotblock1" src="https://zupimages.net/up/20/21/yljn.png" alt="img" />
<div class="homebot-footer-right">
<p class="homebottxt1">ADVANTAGEOUS CONDITIONS</p>
<p class="homebottxt2">We use your money to make a source of long-term profit. At the same time you become both our client and a shareholder.</p>
</div>
</div>
</div>
</div>
</body>
</html>
You can design like this.
The key point here is to use flex layout.
Using flex layout by display: flex, you can make this structure easily.
Since you are applying inline-block to the image separately, it is not horizontally aligning the image to any other element in the page.
To achieve your result, you will need to create a div structure that suits your needs and then apply your property.
Also, use flex instead of inline-block, it's much powerful. I have modified your code to achieve your result.
P.S. Kindly add in a padding as per your need. Since it is not the objective of the question, I have not included it in my answer.
*{
margin:0;
padding:0;
}
.homebot{
background:url('https://zupimages.net/up/20/21/9zj3.jpg') no-repeat center;
background-size:cover;
background-attachment:fixed;
min-height:500px;
display:inline-block
width:100%;
}
.homebotbg{
background-color:rgba(255,255,255,0.7);
min-height:500px;
display:block;
width:43%;
float:right;
padding:100px 50px 50px 30px;
text-shadow:#fff 1px 1px 0px;
text-align:left;
}
.homebottit{
font-size:24pt;
font-family:roboto;color:#c22312;
text-transform:uppercase;
margin-bottom:50px;
display:inline-block;
}
.homebotpad{
padding-left:10px;
}
.homebottxt1{
font-size:16pt;
font-family:roboto;
color:#000;
}
.homebottxt2{
font-size:10pt;
font-family:open sans2;
color:#000;
}
.block{
display: flex;
}
.homebotblock1{
width:80px;
display:inline-block;
}
.homebotblock2{
width:450px;
display:inline-block;
}
<!Doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Titre de la page</title>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<body>
<div class="homebot">
<div class="homebotbg">
<span class="homebottit">Security Investment Solutions</span>
<div class="block">
<img class="homebotblock1" src="https://zupimages.net/up/20/21/yljn.png" alt="img" />
<div>
<div class="homebottxt1">ADVANTAGEOUS CONDITIONS</div>
<div class="homebottxt2">We use your money to make a source of long-term profit. At the same time you become both our client and a shareholder.</div>
</div>
</div>
</div>
</div>
</body>
</html>

Center content in HTML table layout

I created my first email template (exercise). In the beginning I did it without tables, but later I converted it to tables. Now I have a mess; I'd like to center all text and the header, but I don't know how. I've used table-align but it did not work.
Code before (divs):
https://jsbin.com/pusokiyido/edit?html%2Coutput
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>emailer</title>
<meta name="description" content="Interaktywny poradnik szybkiego startu dla Brackets.">
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
html, body {
/*font-size: calc 8px + (16 -8) * ((100vw - 200px) / (1200 - 200))); */
color:white;
}
}
.emailer-background {
background:#eee;
}
.emial-container {
max-width: 700px;
background: #fff;
font-family: sans-serif;
text-align: center;
margin: 0 auto;
display:block;
overflow: hidden;
border-radius: 5px;
margin-bottom:30px;
}
.text{
font-size: 0,6em;
margin-left: 5px;
margin-right:5px;
padding-left:5px;
padding-right:5px;
padding-top:20px;
color:white !important;
}
.center{
max-width: 100%;
margin-left: auto;
margin-right: auto;
}
.content {
background-image: url("img/bg.jpg");
background-color: #793985;
background-repeat: no-repeat;
background-size: cover;
}
.slogan h1 {
font-size: 3vw;
color:white;
padding-right:10px;
padding-left:10px;
letter-spacing:-0.6pt;
line-height:/*44pt*/ 2,7vw; }
.separator {
background-color: rgba(154, 207, 141, 0.1);
background: rgba(154, 207, 141, 0.1);
}
/*.separator h1, h2, h3 {
color:white !important; */
}
.separator h2 {
font-size:1,5vw;
}
.column {
float: left;
width: 33.33%;
padding: 5px;
}
img {
max-width:100%;
}
.flexcontainer {
display: -webkit-flex;
display: flex;
-webkit-flex-direction: row;
flex-direction: row;
align-items: center;
justify-content: space-around;
padding-top:10px;
}
.qr, .logo {
padding-right:10px;
padding left:10px;
min-width:45px;
}
.logo {
max-width:80px;
min-width:45px;
}
.link {
letter-spacing:10pt;
font-size:16px !important;
padding-top:15px;
padding-bottom:15px;
}
.koperta li:before{
content: “\f13d”;
font-family: “FontAwesome”;
width: 10px;
height: 10px;
margin-right: 5px;
}
</style>
</head>
<body>
<div class="emailer-background">
<div class="emial-container">
<div class="content">
<div class="separator">
<img src="img/heder.jpg" alt="header image">
<div class="text"><b>usługi fotograficzne</b>: wywoływanie fotografii z każdego typu nośnika i klisz, renowacja,
retusz zdjęć, fotografia okolicznosciowa, sesje fotograficzne studyjne i plenerowe, fotografia
reklamowa i katalogowa, akcesoria foto, <br>ramki, albumy, kubki, koszulki, poduszki z Twoim projektem</p>
<p><b>usługi poligraficzne:</b> ksero, bindowanie, drukowanie, skanowanie. </div>
</div><!--separator end-->
<div class="slogan">
<h1>Zamrażanie chwil
<br>i malowanie światłem <br>
to sztuka ! </h1>
</div>
<div class="slogan2">
<div class="separator">
<h2>Chcesz zobaczyć jak to działa?<br>
Przyjdź, przyjmiemy Cię z radością ! </h2>
</div>
</div><!--slogan 2 end-->
<div class="flexcontainer">
<div class="qr">
<img src="img/qr.svg">
</div>
<div class="logo">
<img src="img/logo.svg">
</div>
<div class="qr">
</div>
<div>
<ul class="fa-ul">
<li class="koperta"> Email: <br>zorza.studio#gmail.com</li>
<li>Tel. <b>697 625 645</b></li>
</ul>
</div>
</div><!--- felx end-->
<div class="separator">
<h2 class="link">facebook.com/zorza.studio</h2>
</div>
</div><!--content end-->
</div><!--container end-->
</div><!--background end-->
</html>
After (tables)
https://jsbin.com/muzokadutu/edit?html,output
text-align:left/rignt/center !important ;
try this.
Remove text-align: center; in .emial-container.

Washed out and faded images when generating a PDF within a .net core project

I have a .net core project where I am saving an HTML template string into a PDF via DinkToPdf. Whilst I am successfully generating a PDF file, I am seeing some odd behaviour around images where they are appearing washed out/faded.
Please note I do not have this issue with the generated HTML itself.
The two links below show how the images should (and do within the HTML template) appear and how they appear within the PDF.
How the images appear within the HTML template.
Images appear faded from the generated PDF file.
Interestingly, the first image in the generated PDF does not suffer from this issue (not shown). I have compared this image with the other "washed out" images and the key difference was around their DPI (72dpi vs. 96dpi), as a test I updated one of the faded images to the same DPI but the problem persists.
Below is my PDF generation code:
/// <summary>
/// Generates the specified HTML content into a PDF byte array.
/// </summary>
/// <param name="htmlContent">Content of the HTML.</param>
/// <param name="documentTitle">The document title.</param>
/// <returns>Byte array of the generated PDF contents.</returns>
public static byte[] Generate(string htmlContent, string documentTitle)
{
var converter = new BasicConverter(new PdfTools());
var document = new HtmlToPdfDocument
{
GlobalSettings
=
{
ColorMode = ColorMode.Color,
Orientation = Orientation.Portrait,
PaperSize = PaperKind.A3,
DocumentTitle = documentTitle
},
Objects =
{
new ObjectSettings
{
PagesCount = true,
HtmlContent = htmlContent,
WebSettings =
{
DefaultEncoding = "utf-8"
}
}
}
};
// Return the PDF content in a byte array.
return converter.Convert(document);
}
And the HTML code:
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Tagging -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Titles -->
<title>Page Title</title>
<!-- Styles -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<style>
body {
margin-left: 10px;
margin-top: 30px;
}
#content {
width: 100%;
margin: 0 auto 0 auto;
}
h1 {
float: right;
text-transform: uppercase;
white-space: nowrap;
}
h2 {
color: #1E86B1;
font-size: x-large;
}
h2.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
width: 500px;
}
a {
color: #1E86B1;
font-weight: bold;
}
a:hover {
color: #1E86B1;
}
.thead-inverse th {
background-color: #1E86B1;
}
td {
text-align: right;
}
.container {
clear: both;
}
.logo {
width: 100px;
}
.screenshot {
border: solid 1px #ccc;
float: right;
}
.intro {
margin-bottom: 0;
margin-top: 30px;
}
.intro a {
color: #fff;
font-weight: bold;
}
.intro h2 {
font-size: x-large;
margin: 0;
padding: 0 0 15px 0;
}
.composition-cards p:last-of-type {
margin-bottom: 30px;
}
.cards {
text-align: center;
width: 100%;
}
.card {
display: inline-block;
float: left;
margin: 0 0 6px 6px;
text-align: left;
width: 49%;
}
.card-body h2 {
border-bottom: solid 1px #000;
color: #000;
font-size: 4rem;
font-weight: 700;
margin: 0;
margin-bottom: 6px;
padding-bottom: 6px;
}
.card:nth-child(3n) {
margin-right: 0;
}
.card-img-top {
border-bottom: 1px solid rgba(0, 0, 0, .125);
}
.clip {
background-clip: content-box;
display: table;
margin-left: 0;
overflow: hidden;
padding-right: 0;
padding-top: 95px;
position: relative;
}
.clip>div>p {
color: #fff;
font-size: large;
margin: 0;
width: 95%;
}
.clip>div {
display: table-cell;
vertical-align: middle;
}
.clip>div:first-child {
background-color: #42BCE2;
border: solid 1px #42E0E2;
border-right: none;
border-bottom-left-radius: 15px;
border-top-left-radius: 15px;
padding: 30px 0 30px 30px;
}
.clip-screenshot {
border: solid 1px #eee;
padding: 0;
}
.compositions h3 {
color: #fff;
font-size: large;
text-transform: uppercase;
}
.compositions .row .col {
background-color: #42BCE2;
border: solid 1px #42E0E2;
border-radius: 15px;
margin: 5px;
padding: 20px;
}
.divider,
.no-divider {
border-bottom: solid 1px #eee;
padding: 30px 0 30px 0;
}
.divider:last-of-type,
.no-divider {
border-bottom: none;
margin-bottom: 10px;
}
.divider:last-of-type>div>div {
color: #666;
text-align: center;
}
.divider:last-of-type>div>div a {
font-weight: normal;
}
</style>
</head>
<body>
<div id="content">
<div class="container no-divider">
<div class="row">
<div class="col composition-cards">
<div class="cards">
<div class="card">
<img class="card-img-top" src="{serverProcessingImage}">
<div class="card-body">
<h4 class="card-title">Card Title</h4>
<p class="card-text">
Content here...
</p>
</div>
</div>
<div class="card">
<img class="card-img-top" src="{htmlFilesImage}">
<div class="card-body">
<h4 class="card-title">Card Title</h4>
<p class="card-text">
Content here...
</p>
</div>
</div>
<div class="card">
<img class="card-img-top" src="{imagesImage}">
<div class="card-body">
<h4 class="card-title">Card Title</h4>
<p class="card-text">
Content here...
</p>
</div>
</div>
<div class="card">
<img class="card-img-top" src="{javaScriptImage}">
<div class="card-body">
<h4 class="card-title">Card Title</h4>
<p class="card-text">
Content here...
</p>
</div>
</div>
<div class="card">
<img class="card-img-top" src="{otherResourcesImage}">
<div class="card-body">
<h4 class="card-title">Card Title</h4>
<p class="card-text">
Content here...
</p>
</div>
</div>
<div class="card">
<img class="card-img-top" src="{styleSheetsImage}">
<div class="card-body">
<h4 class="card-title">Card Title</h4>
<p class="card-text">
Content here...
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
The images themselves are pulled in and converted into byte arrays - these are then Base64 encoded into the HTML template. The same code to pull down and encode the images is used so I do not currently see this as the root cause.
Please do share any thoughts/suggestions with me. Thanks, Ben.
After stripping back the template code to various stages, I spotted my class card-img-top had a bottom border colour value set via RGBA.
As a quick test, I removed this class and the issue was resolved. I then altered the RGBA value with a hex code instead and the issue is no longer replicable.
Doing some further research this looks to have been a known issue within WKHTMLTOPDF: https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1932

CSS not loading properly in jsp, tomcat and servlet

Login.css
body {
font-family: "Trebuchet MS", Tahoma, Arial, Geneva, sans-serif, Helvetica, sans-serif;
font-size: 13px;
background: url(../images/bg.png) 0 64px repeat-x;
margin: 0;
}
.wrapper {
xmargin: 0 auto;
}
#border-top.h_green {
background: url(../images/j_header_middle.png) repeat-x;
height: 84px;
xmargin: 0 auto;
}
#contentbox {
width: 755px;
margin: 0 auto;
xbackground: #efefef;
padding: 0px;
position: relative;
}
#header-top {
width: 960px;
margin: 0 auto;
xbackground: #efefef;
padding: 0px;
position: relative;
}
#menuheader {
position: relative;
}
#contentbox p {
padding: 0 0 10px 0;
}
#menubox {
background: #fff;
padding: 3px 10px;
border-left: 1px solid #cccecc;
border-right: 1px solid #cccecc;
height: 15px;
}
#user_name {
position: absolute;
right: 0px;
top: 0px;
xbackground: url(../../../images/icons/user.png) no-repeat scroll 0 2px
transparent;
padding-left: 20px;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
color: #666;
}
.loginwrapper {
width: 755px;
margin: 0 auto;
}
.btn{
background:url(../images/btn.jpg) repeat-x;
height:28px;
border:none;
color:#fff;
margin-top:20px;
}
.loginbox {
background: url(../images/login_shadow.png) no-repeat;
height: 310px;
padding: 40px;
}
.rightsection {
width: 85%;
float: right;
border-bottom: 1px solid #cccc;
}
.rightboxwrapper {
float: left;
width: 325px;
padding-right: 30px;
background: url(../images/loginleft.png) no-repeat center bottom;
height: 262px;
}
.rightboxwrapper .loginheader h2 {
color: #0588ab;
font-size: 16px;
font-family: trebuchet MS;
margin: 0;
text-align: left;
}
.loginform input {
width: 170px;
}
.loginform input#btnsubmit {
width: 80px !important;
border: none;
}
.loginform {
padding: 10px 0 0 45px;
line-height: 35px;
background: url(../images/lock.png) no-repeat right center;
width: 335px;
}
.loginform td {
color: #333333;
font-family: trebuchet MS;
font-size: 12px;
padding: 0;
margin: 0;
}
.copyright {
width: 100%;
text-align: right;
padding: 5px 0px;
font-size: 11px;;
color: #0588ab;
font-family: trebuchet MS;
}
.copyright p {
padding-right: 15px !important;
}
index.jsp
<%# page language="java" contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<title>Login Page</title>
<link rel="stylesheet" type="text/css" href="css/login.css"/>
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/jquery.validate.js" type="text/javascript"></script>
<script src="js/jquery.metadata.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#commentForm1").validate({meta: "validate"});
required: 'Enter this!'
});
</script>
<style type="text/css">
form { width: 500px; }
form label { width: 250px; }
form label.error,
form input.submit { color: red; font-size: 20px; }
</style>
</head>
<body>
<div class="wrapper">
<!--maindiv wrapper starts-->
<div id="border-top" class="h_green">
<!--header starts-->
<div id="header-top">
<div><img width="249" height="54" style="padding:15px 0 0 0px" src="images/companylogo.png"> </div>
</div>
</div>
<div id="contentbox">
<div style="background:none;border:none;" id="menubox">
<div id="menuheader">
<div id="message">
<p style="text-align:center; padding-top:10px;" class="message_text"> </p>
</div>
<div id="user_name">
</div>
</div>
</div>
<div class="loginbox">
<div style="width:100%!important;" class="rightsection">
<form name="loginform" action="loginServlet" method="post" id="commentForm1">
<div class="loginwrapper">
<div class="rightboxwrapper">
<table cellspacing="0" cellpadding="0" border="0" align="center" class="loginform">
<tbody><tr class="loginheader">
<th style="color:#0588ab; font-size:12px; font-family:Helvetica; text-transform:uppercase; height:35px;"> <h2>Login</h2></th>
</tr>
<tr>
<td style="color:#0588ab; font-size:12px; font-family:Helvetica; text-transform:uppercase; height:25px;">User ID </td></tr>
<tr>
<td style="color:#0588ab; font-size:12px; font-family:Helvetica; text-transform:uppercase; height:25px;"><input type="text" id="username" name="username" class="{validate:{required:true, messages:{required:'*'}}}"></td>
</tr>
<tr>
<td style="color:#0588ab; font-size:12px; font-family:Helvetica; text-transform:uppercase; height:25px;">Password</td></tr>
<tr>
<td style="color:#0588ab; font-size:12px; font-family:Helvetica; text-transform:uppercase; height:25px;"><input type="password" id="password" name="password" class="{validate:{required:true, messages:{required:'*'}}}"></td>
</tr>
<tr>
<td colspan="2">
<input value="Login" class="btn" style="width:60px;" type="submit"/>
<input value="Reset" class="btn" style="width:60px; margin-left:10px;" type="reset"/>
</td>
</tr>
</tbody></table>
</div>
<div class="imagewrapper">
<img width="323px" height="262px" src="images/loginimg.png">
</div>
</div> <div style="clear:both; color:fff"></div>
</form>
</div>
<div class="cleared"></div>
</div>
<div id="footerwrapper"><!--Div for the Footer -->
<div class="copyright">
<p>Copyright © 2012 BitsCrafters HRM All rights reserved.</p>
</div><!--ended Footer Div-->
</div>
</div>
</div>
</body>
</html>
What is wrong with this code? can anyone help me out of this? There is something wrong because when i run it through tomcat sometime its work but sometime it doesn't work some icon and image is not displayed. In browser i checked view source to check whether css path is correct or not it is correct.
Ran into the same, just correct the href path:
<link rel="stylesheet" type="text/css" href="./css/login.css"/>
The code and CSS look correct at first glance, so the error is elsewhere.
Use a tool like Firebug or "Inspect Element" to check what your browser gets. All these tools have a network tab where you can see what the browser requested and what it got. Look for:
Do you see all the URLs that you expect?
Could the server serve all these (HTTP status 200)
Check the content of the files. Do they contain what you expect?
Check the error console. Do you get any CSS / JavaScript errors?
Inspect the element in question. Does it have the correct CSS styles? In the CSS panel, do you see the correct styles?

How to make a css compatible by all browser

i'm developing an header like:
This is the code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/base1.css">
<link type="text/css" href="css/ui-lightness/jquery-ui-1.8.21.custom.css" rel="stylesheet" />
<script type="text/javascript" src="lib/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="lib/js/jquery-ui-1.8.21.custom.min.js"></script>
<title>Crociere sul web - Ricerca avanzata</title>
</head>
<body>
<div id="header">
<div id="header_content">
<div id="text">
NAME OF COMPANY
</div>
<div id="header_prenotazioni">
My prenotation
</div>
<div id="header_phone">
<img id="phone" src="images/logo/logo_phone.png" /><b>xxxxxxxxxx</b>
</div>
<script>
( function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id))
return;
js = d.createElement(s);
js.id = id;
js.src = "//connect.facebook.net/it_IT/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div class="fb-like" data-href="https://www.facebook.com/xxxx" data-send="true" data-layout="button_count" data-width="20" data-show-faces="false" data-font="verdana"></div>
<div id="area_agenzie">
<div align="center">
AGENCY AREA
</div>
</div>
</div>
</div>
</body>
</html>
And this is css:
html, body {
margin: 0;
padding: 0
}
div#header {
width: 100%;
background-color: #0170a8;
color: white;
font-size: 9px;
font-family: Verdana;
overflow: hidden;
}
div#header_content {
margin: 0 auto;
width: 90em;
overflow: hidden;
padding-bottom: 4px;
padding-top: 4px;
}
div#text{
float:left;
}
div#header_prenotazioni {
margin-left: 100px;
border-left: 1px dotted white;
border-right: 1px dotted white;
padding-left: 6px;
float:left;
padding-right: 6px;
}
div#header_phone {
margin-left: 10px;
font-size: 11px;
border-right: 1px dotted white;
padding-right: 6px;
float:left;
}
div#header_phone img {
vertical-align: middle;
}
div#area_agenzie {
background-color: #b5c85f;
color: #0170a8;
height: 20px;
-moz-border-radius: 3px;
border-radius: 3px;
font-size: 11px;
display: inline-block;
vertical-align: top;
}
div#area_agenzie div {
margin-top: 3px;
padding-left:2px;
padding-right:2px;
}
My problem is that is not compatible with IE.. the AGENCY AREA goes on next row... how can i solve it? can someone help me? thanks!!!
You appear to be using float: left for most of them, and display: inline-block for the last one. Since you have a fixed-width container, it seems like IE's font rendering is just enough to send the last block to the next line.
Instead, try replacing all those float: left with display: inline-block, and instead of having width: 90em, try text-align: center;. This should make everything appear on one line.

Resources