Solved

how set full image in a html file

Posted on 2012-03-29
4
160 Views
Last Modified: 2012-04-02
hi

i have an html file , and i have a bakground image and i need it set to 100% browser, but it let me a grey space at right

someone could help me pleasae

thanks a lot
error-image-size-100.JPG
index.html
0
Comment
Question by:tenriquez199
  • 2
4 Comments
 
LVL 8

Expert Comment

by:Ben McNelly
Comment Utility
CSS3 way, needs more code to get working in IE8 and below, but works in 9

html {
	background: url(images/bg.jpg) no-repeat center center fixed;
	-webkit-background-size: cover;
	-moz-background-size: cover;
	-o-background-size: cover;
	background-size: cover;
}

Open in new window


for IE8 and below add in
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.myBackground.jpg', sizingMethod='scale');
-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='myBackground.jpg', sizingMethod='scale')";

Open in new window

0
 
LVL 21

Accepted Solution

by:
Kim Walker earned 500 total points
Comment Utility
There are some CSS3 features that might help you. I haven't used them yet. Here's a good reference: w3schools.com
0
 
LVL 1

Author Comment

by:tenriquez199
Comment Utility
benmcnelly

thanks

where put that code? at block body?
0
 
LVL 8

Expert Comment

by:Ben McNelly
Comment Utility
@xmediaman, enjoy your poinks ;)

In regards to placing the code on the page to do this you need to locate where (if at all) you are loading in or using CSS on your page. You can link to an external stylesheet or place the code in the page directly. The safest way to use the above coded is to place it between a style tag at the end of the HEAD section. It will overide any previous CSS (see this for refrence http://www.nzwhost.com/article/understanding-css-hierarchy )

Here is how it would be implemented on the page you attached... sample: http://benmcnelly.com/EE/example.html

<!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>Documento sin título</title>
<style type="text/css">

html {
	background: url(http://newevolutiondesigns.com/images/freebies/hd-wallpaper-33.jpg) no-repeat center center fixed;
	-webkit-background-size: cover;
	-moz-background-size: cover;
	-o-background-size: cover;
	background-size: cover;
}

body {
	font-size: 14px;
	padding-left: 200px;
	padding-top: -10px;
	position: absolute;
	top: 10px;
	background-repeat: no-repeat;
	background-size : 100%;
	width: 100%;
	height: 100%;
}

Open in new window

0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
jQuery Time Off Event 20 42
HTML Lists 3 29
Best Practice CSS floating images 2 15
modify h2 4 8
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now