Solved

how set full image in a html file

Posted on 2012-03-29
4
165 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 8

Expert Comment

by:Ben McNelly
ID: 37784333
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 22

Accepted Solution

by:
Kim Walker earned 500 total points
ID: 37784355
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
ID: 37784410
benmcnelly

thanks

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

Expert Comment

by:Ben McNelly
ID: 37796407
@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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
asp.net, radiobuttonlist, c# 3 69
ninja forms fields lay next to each other 1 23
SSL unsecure page mystery 17 47
Can't Find The Code 15 21
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

751 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