Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2008-10-16
5
Medium Priority
?
250 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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I. Introduction In a previous article (http://www.experts-exchange.com/Web_Development/Document_Imaging/A_6537-PaperPort-Upgrade-How-to-download-and-install-updated-versions-of-PaperPort-11-and-12.html) (now deprecated), I discussed how to upgrad…
PaperPort 14.5 Patch 1 update is often not detected or downloaded automatically. This article provides direct download links to solve the problem for retail (non-bundled) versions of the Standard and Professional editions, as well as the Professiona…
The goal of the tutorial is to teach the user how to import photos into Adobe Lightroom efficiently and to keep everything organized.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

886 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