set an image just for background of the header page - header

I am a junior web designer. I have a problem. please help me... I'm trying to make a website and I want to set a background just for header not for all of the page.what should I do?

Try this :
<!DOCTYPE html>
<html>
<head>
<style>
body {
display: inline-block;
background-image: url("http://s6.uplod.ir/i/00893/uhz63f8xhn0n.jpg");
}
</style>
</head>
<body>
<p>Ahmad</p>
</body>
</html>

Related

Magnific Popup AutoLoad on Page Loading... Not Working

I installed this code on a single page PHP page and it works the way I want it to. Problem is page I need to install it on is broken up into 4 PHP pages.(Home.php, which also includes, Header, Menu, and Footer PHP pages...) and I can't get the code to work. I've tried installing it different places but no luck... if anyone can help would be much appreciated... Code is below.
page to install on is: http://tonysatthejhouse.com THANKS!!
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/magnific-popup.css" />
<link rel="stylesheet" href="http://tonysatthejhouse.com/superadmin/assets/css/Mag3.css" />
</head>
<body>
<h1>THIS IS A TEST</h1>
<script data-require="jquery#1.9.1" data-semver="1.9.1" src="https://code.jquery.com/jquery-1.9.1.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.js"></script>
<script src="http://tonysatthejhouse.com/superadmin/assets/js/MagJS4.js"></script>
</body>
</html>
$(document).ready(function() {
$.magnificPopup.open({
items: {
src: 'http://tonysatthejhouse.com/superadmin/assets/extraimages/Restaurant_Week AD-01.jpg', // can be a HTML string, jQuery object, or CSS selector
type: 'image'
}
});
})
.white-popup {
width:500px;
height:700px;
overflow:auto;
padding:10px;
background:white;
border:2px solid black;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}

how to create separated pages in same pdf document using play pdf

I'm using play2-pdf to generate pdf in my application I created firstly the cover page but when I try to add the other pages its added in the same pdf page how can I create multiple pages in the same pdf document also I'm trying to add a footer to the my first page but still have the same problem
<html>
<head>
<style>
p.serif {
font-family: "Times New Roman", Times, serif;
}
p.sansserif {
font-family: Arial, Helvetica, sans-serif;
}
</style>
</head>
<body>
this is a test
<div style="position:absolute; bottom:0;right:0;margin:24px;">by bSuccess</div>
</body>
</html>
For headers and footers, you can use css paged media module (https://www.w3.org/TR/css3-page/)
Example:
<html>
<head>
<style>
##page {
##bottom-right {
content: "by bSuccess";
font-size: 14px;
}
}
</style>
</head>
<body>
this is a test
</body>
</html>
For page breaks, you can use css page break properties (https://css-tricks.com/almanac/properties/p/page-break/)
Example:
<html>
<head>
<style>
##page {
##bottom-right {
content: "by bSuccess";
font-size: 14px;
}
}
</style>
</head>
<body>
<div>this is a test</div>
<p style="page-break-after:always;"></p>
<div>testing page break</div>
</body>
</html>

very basic dojo: button not displaying icon

i am new to dojo and i am trying to make a button with an image, but the image does not show, besides, when one clicks the button, it correctly shows the "hi" alert.
the "zoom_in.png" image is right in the same directory with the html. And firebug shows no errors or warnings.
Update. thanks to ed, i managed to get it working via the declarative approach
<!DOCTYPE html>
<html >
<head>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.10.3/dijit/themes/claro/claro.css">
<script>dojoConfig = {parseOnLoad: true}</script>
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.10.3/dojo/dojo.js"></script>
<script>require(["dojo/parser", "dijit/form/Button"]);</script>
<style>
.zoom_in_icon {
background-image: url('zoom_in.png');
height: 25px;
width: 25px;
text-align: center;
background-repeat: no-repeat;
}
</style>
</head>
<body class="claro">
<button data-dojo-type="dijit/form/Button" data-dojo-props="iconClass:'zoom_in_icon'" type="button">
<script type="dojo/on" data-dojo-event="click" data-dojo-args="evt">
require(["dojo/dom"], function(dom){
alert( "Thank you! ");
});
</script>
</button>
<div id="result2"></div>
</body>
</html>
However, programatically, the problem persists
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Button</title>
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.10.3/dojo/dojo.js" data-dojo-config="async: true"></script>
<style>
.zoom_in_icon {
background-image: url('zoom_in.png');
height: 250px;
width: 250px;
text-align: center;
background-repeat: no-repeat;
}
</style>
<script>
require([
"dijit/form/Button",
"dojo/domReady!"
],
function(Button) {
new Button({
title: 'Zoom in', iconClass:'zoom_in_icon',
onClick: function() { alert("hi"); }}, "zoom_in").startup();
});
</script>
</head>
<body>
<button id="zoom_in" type="button"></button>
</body>
</html>
thanks
If you want to create the button programatically you need to call startup() on the new Button, and you don't need the data-dojo-type="dijit/form/Button" or the parse in the html, if you want to create it declaratively you don't need the new button, but you need to set the icon in the html.
See the Programatic example here:
http://dojotoolkit.org/reference-guide/1.10/dijit/form/Button.html

Cannot get rid of Safari's image border

This is driving me nuts — I cannot place the image in src="", because border-radius will then fail. So, I moved it to background: url(), but then Safari keeps pushing this annoying border towards my face. How can I get rid of it ...?!
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<img style="width: 500px; height: 500px">
</body>
</html>
Are you sure about the border radius? This works for me:
<!DOCTYPE html>
<html lang="en">
<body>
<img src="test.png" style="border-radius: 10px"/>
</body>
</html>
Rendering:
Safari 5.0.3 (6533.19.4), the default 10.6.5 browser.
If you want to get rid of the border set it in CSS file, do something like:
set all the images borderless
img {border:none}
or using a CSS class
img.nobrdr {border:none}
or specifying the container like on of these
#container img {border:none}
.container img {border:none}
also specifying a class inside the container
.container img.nobrdr {border:none}

How to apply gradient color in css?

I want to use gradient color as my page background
how do I apply css to get gradient background?
See:
Cross-Browser CSS Gradient
(source: webdesignerwall.com)
CSS 3 supports gradients but this won't be supported by all browsers (eg IE6).
But you could do this, which I think is pretty similar to the previous answer:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
body {
padding:0px;
margin:0px;
}
div#bg {
background: url(http://www.khiba.com/PSP/FALL01/Testgrad.jpg) repeat-x;
height:600px;
}
</style>
</head>
<body>
<div id="bg">
</div>
</body>
</html>
if you want your site to be compatible with all browsers, you can use this :
background-image: url(someurl.gif);
background-repeat: repeat-x;
the someurl.gif image should contain the gradient that you want. Have it as a very small piece of image and you can extend it with repeat-x or repeat-y. whichever you prefer.
You can use the linear-gradient function in CSS.
Add this to your css file:
body {
background: linear-gradient(0deg, COLOR1, COLOR2);
}
Replace COLOR1 with the first color and COLOR2 with the second color.