Solved

Why can't I enter a table into this background file, without pushing the background downward?

Posted on 2008-10-16
5
241 Views
Last Modified: 2013-12-02
Here is the source code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html template="true">
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="content-type">
  <title>Famous Computer Scientists &amp; Mathematicians</title>
  <meta content="BML" name="author">
  <meta content="Background template" name="description">
</head>
<body>
<table border="1" cellpadding="2" cellspacing="2"
 width="100%">
  <tbody>
    <tr>
      <td></td>
      <td></td>
    </tr>
    <tr>
      <td></td>
      <td></td>
    </tr>
    <tr>
      <td></td>
      <td></td>
    </tr>
    <tr>
      <td></td>
      <td></td>
    </tr>
    <tr>
      <td></td>
      <td></td>
    </tr>
    <tr>
      <td></td>
      <td></td>
    </tr>
  </tbody>
</table>
<img alt="Blue Background"
 src="file:///C:/Users/blerman/Documents/ED569.A/web_page_ed569/background.gif"
 height="1200" width="1600">
</body>
</html>
0
Comment
Question by:blerman456
  • 3
  • 2
5 Comments
 
LVL 13

Expert Comment

by:brundo
ID: 22733152
Hi,

you have the image immediately after the table.

You can add the background via style attribute in the body or table tag - depending or where you want the background:

  <body style="background-position: 0% 0%; background-image:url('relativepath/imagename.gif'); background-repeat:no-repeat; background-attachment:scroll">

or

  <table border="1" cellpadding="2" cellspacing="2" style="background-position: 0% 0%; background-image:url('relativepath/imagename.gif'); background-repeat:no-repeat; background-attachment:scroll" width="100%">

Url could be

  url('filename.extension')

if the background picture is in the same folder as the HTML file, or something like

  url('aaa/filename.extension')

if the background file filename.extension is in the subfolder of the folder where the HTML file residues, and its name is aaa.

0
 

Author Comment

by:blerman456
ID: 22733568
What does the % sign mean in the below part of your answer:

 <body style="background-position: 0% 0%; background-image:url('relativepath/imagename.gif'); background-repeat:no-repeat; background-attachment:scroll">
0
 
LVL 13

Accepted Solution

by:
brundo earned 500 total points
ID: 22733656
Try following combinations instead of 0% 0%:

50% 0%0% 50%50% 0%
Do you see :-)) ?

Instead of 0% 0% can stay 0 0 (in pixels) or top left, but I had something else in mind...

More about background positioning you can find on the page http://www.w3schools.com/css/pr_background-position.asp.
0
 

Author Closing Comment

by:blerman456
ID: 31506746
This guy is great.  I assume he is a guy - is that correct?  So very very smart.
0
 
LVL 13

Expert Comment

by:brundo
ID: 22738505
No, not a guy... female... Only my nickname is a male bear name :-))
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
This article shows how to convert a multi-page PDF file into multiple image files, with one image file created for each page of the PDF. It does this by utilizing an excellent, free software package called GraphicsMagick. The solution is amazingly s…
The goal of this is to tech the user how to export photos out of Lightroom and the different options they have. Select which photos you want to export : Select where you want to export and with which options : Export :
The goal of the tutorial is to teach the user what gradient filters are and how to use them. When you have a photo and some part of the photo is either over exposed or under exposed, you use a gradient filter to help mask the need to touch up th…

760 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