Zymic Forums

Webmaster resources

Zymic IRC Server

Chat in real time at irc.zymic.com - Learn More

Welcome

Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.

In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.

left Zymic Webmaster ForumsWeb Design & DevelopmentGeneral Web Design Discussion right
  Reply to this topic Start new topic
left right
alden1
post Jul 22 2012, 07:55 AM
Post #1


Newbie
*

Group: Members
Posts: 2
Joined: 10-July 12
Member No.: 248,594



I have just started with css and my first project is being ruined. Help!
I wrote a small html page:

<html>
<head>
<style type="text/css">
body
{
background-image:url("..\bk.jpg");
}
</style>
</head>
<body>
<p> text text text text text </p>
</body>
</html>

[Do not worry about the path.]
Such a simple code is not working. The problem is with the background image. It is not showing up. But it shows in IE9! No other browser shows it.
I even can't write it in HTML because i need a repeat of the image.


london airport transfers
Go to the top of the page 
 
  + Quote Post
AirOgames.zxq.ne...
post Jul 22 2012, 08:38 AM
Post #2


Member
**

Group: Members
Posts: 32
Joined: 5-April 12
Member No.: 236,922



Hi

U can also just use a simple html tag

<Body background=".../bg.png ">

That would work niceley for you it also repeats thr back ground.

Any other help just ask.
Go to the top of the page 
 
  + Quote Post
ssfdre38
post Jul 22 2012, 02:54 PM
Post #3


THE SILENT FORUM NINJA
*******

Group: Administrators
Posts: 3,758
Joined: 23-January 10
From: on your screen
Member No.: 127,507



well remove ../ from it as well
Go to the top of the page 
 
  + Quote Post
zpcs
post Jul 23 2012, 08:53 PM
Post #4


Marvellous Ninja
******

Group: Members
Posts: 570
Joined: 10-May 09
From: Wisconsin state, United States of America
Member No.: 94,482



Hi alden1,
It is such a simple code: the background image path need(s) correction.

Following through on the ssfdre38 mention provides the below corrected CSS [body background image call] code:
CODE
<html>
  <head>
    <style type="text/css">
        body {
             background-image:url("bk.jpg");
             }
    </style>
  </head>

  <body>
    <p> text text text text text </p>
  </body>
</html>


As AirOgames.zxq.net mentions, the In-Line HTML code could be as below:
CODE
<html>
  <head>
  </head>

  <body background="bk.jpg">
    <p> text text text text text </p>
  </body>
</html>


Both of the above code corrections provide a page filled by "X" (horizontal) and "Y" (vertical) Repeats of the background image.

Initially you had "background-image:url("..\bk.jpg");" wherein the " ..\ " (a possible leftover of the classic DOS filename call - which doesn't work in conventional HTML Source Code for call). For web page coding; the actuality of "ascending to the ROOT Folder" (navigating to a relational previous hierarchical folder within the web site structure) utilizes a " ../ ".
As the "*.jpg background image" file is presumed not be be in another folder away from your simple code (web page), the use of the ascender is not warranted.

Example: the HTML file was placed in an "images" folder (let's say) and the background image file was placed in the "ROOT" Folder (which has the "images" folder immediately within it) ... then the use of the "background-image:url("../bk.jpg");" (in corrected form) would be appropriate to get the "Root" Folder's background image file to display from the web page resident in the "images" folder.

Hope this helps out a little more.
Go to the top of the page 
 
  + Quote Post
 Reply to this topic Start new topic
left right
0 Members:
left right
 


Lo-Fi Version Time is now: 19th June 2013 - 05:48 AM