473,729 Members | 2,309 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Selective background tiling - this may be tricky.

Hello all,

I need somehelp with background tiling. I have a sneaking suspicion that
what I want to do is not possible, but I'll ask anyway. :>) First some
background: Here's the site in question: www.sayatnova.com (I'm sure many of
you have seen this before as I've often asked for help).

I've come a long way since I first created the site many moons ago and I'm
trying to convert it to a (1) Table-less, (2) Frame-less and (3) Validated
Strict design. Item #1 is done, #3 is mostly done (Loose standard because of
the frames), but #2 is *almost* done. I've dropped from three frames to two
by finding a better menu system and moving the menu out of a frame.

I have a frame on the left and I'm trying to remove it while retaining the
site's look. Some of the pages (About Us, FAQ, Mission Statement and others)
have a tiled image as the background. Since the page is loaded in a separate
frame, it can be tiled indefinitely when the window is resized.

I've played around with the page in no frames. I can get the <div>
positioning I want, but the background is more difficult. I need to tile the
background throughout the whole page while keeping the left side (and
preferably the top) black. At first, I tried this:

background: #000000 url('images/background.jpg' ) repeat 250px 50px;

I thought this would *start* tiling the background from left=250px and
top=50px, leaving the rest black. Instead, it *centered* the image at those
points and the image still wrapped around and tiled the background around
the whole page. Then, I tried this:

background: #000000 url('images/background.jpg' ) repeat-y 250px 50px;

This time I got the left side black, but that was only as good as the image
width. When I resized the screen to 1280 x 1024, the image was centered down
the middle and there was black on both sides.

What I need to do is have the image start tiling indefinitly starting at
left=250px and top=50px, but *not* wrap around and cover the whoe page. I've
done some research but I suspect that it can't be done using css.

My only other option, which I'd like to avoid if possible, is to create a
background image that's 1280x1024 in size and use "background : #000000
url('images/background.jpg' ) repeat-y 250px" to vertically tile it. At
smaller resolutions the background will clip, and it will still cover the
page when the screen is resized upwards. The drawback, of course, is that
the file size for an image that large is too big for a background and would
slow down the page. And, what if someone were to view the site at 1600x1200?
I'd be stuck with the same problem.

I've tried putting the background in the Container and Content div's, but
again, that's imperfect. The div's grow and shrink with their content,
leaving awkward and uneven looking black spaces where I don't want them.

So....how can I acheive my goal using css? I'm hoping that someone out
there will whip out a little known command and save my day! :>) I have a
feeling that I'll need to use the large background image.

Thanks in advance...

--
Viken K.
Dec 13 '05 #1
3 3240
Els
Viken Karaguesian wrote:
Hello all,

I need somehelp with background tiling. I have a sneaking suspicion that
what I want to do is not possible, but I'll ask anyway. :>) First some
background: Here's the site in question: www.sayatnova.com (I'm sure many of
you have seen this before as I've often asked for help).

I've come a long way since I first created the site many moons ago and I'm
trying to convert it to a (1) Table-less, (2) Frame-less and (3) Validated
Strict design. Item #1 is done, #3 is mostly done (Loose standard because of
the frames), but #2 is *almost* done. I've dropped from three frames to two
by finding a better menu system and moving the menu out of a frame.

I have a frame on the left and I'm trying to remove it while retaining the
site's look. Some of the pages (About Us, FAQ, Mission Statement and others)
have a tiled image as the background. Since the page is loaded in a separate
frame, it can be tiled indefinitely when the window is resized.

I've played around with the page in no frames. I can get the <div>
positioning I want, but the background is more difficult. I need to tile the
background throughout the whole page while keeping the left side (and
preferably the top) black. At first, I tried this:

background: #000000 url('images/background.jpg' ) repeat 250px 50px;

I thought this would *start* tiling the background from left=250px and
top=50px, leaving the rest black. Instead, it *centered* the image at those
points and the image still wrapped around and tiled the background around
the whole page. Then, I tried this:

background: #000000 url('images/background.jpg' ) repeat-y 250px 50px;

This time I got the left side black, but that was only as good as the image
width. When I resized the screen to 1280 x 1024, the image was centered down
the middle and there was black on both sides.

What I need to do is have the image start tiling indefinitly starting at
left=250px and top=50px, but *not* wrap around and cover the whoe page. I've
done some research but I suspect that it can't be done using css.

My only other option, which I'd like to avoid if possible, is to create a
background image that's 1280x1024 in size and use "background : #000000
url('images/background.jpg' ) repeat-y 250px" to vertically tile it. At
smaller resolutions the background will clip, and it will still cover the
page when the screen is resized upwards. The drawback, of course, is that
the file size for an image that large is too big for a background and would
slow down the page. And, what if someone were to view the site at 1600x1200?
I'd be stuck with the same problem.

I've tried putting the background in the Container and Content div's, but
again, that's imperfect. The div's grow and shrink with their content,
leaving awkward and uneven looking black spaces where I don't want them.

So....how can I acheive my goal using css? I'm hoping that someone out
there will whip out a little known command and save my day! :>) I have a
feeling that I'll need to use the large background image.


It's doable if you're willing to add two more divs to your pages.

<body>
<div id="outer">
<div id="inner">
whatever you have on your page already
</div
</div>
</body>

body{
background: #000000 url('images/background.jpg' );
}
#outer{
background: #000000 url('images/background-y.jpg') repeat-y top left;
}
#inner{
background: #000000 url('images/background-x.jpg') repeat-x top left;
}

background-y.jpg should be black and 250px wide, while
background-x.jpg should be black and 50px high.

Not tested.
Known issues: without setting a height to the #inner and #outer and
body and html, the black vertical bar will stop at the bottom of your
content.
Setting all four elements to 100% height will make the vertical black
bar stop before the end of the viewport if the page is higher than the
viewport in some browsers. There are ways to prevent that from
happening, but I can't remember how off the top of my head atm. I'm
sure someone else knows though, and I think you can make it work.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Dec 13 '05 #2
> It's doable if you're willing to add two more divs to your pages.

I have no problem with that :>)
Not tested.
Known issues: without setting a height to the #inner and #outer and
body and html, the black vertical bar will stop at the bottom of your
content.
Yes. That's what I've been fighting. If I set to 100%, it only spans as far
as the content. If I set fixed height and width, then the div's won't
resize according to the screen size.
Setting all four elements to 100% height will make the vertical black
bar stop before the end of the viewport if the page is higher than the
viewport in some browsers.


Sorry, I'm not sure what you mean by viewport :>( Are you referring to the
viewing area?

Sometimes, I wish that 100% meant 100% of the *page*, so If I set a <div> to
height: 100%, it will span 100% of the page's height, regardless of whether
the content does or not. That would make some things much easier.

Viken K.
Dec 14 '05 #3

"Viken Karaguesian" <vikenkNO_SPAM@ NO_SPAMcomcast. net> wrote in message
news:jI******** ************@co mcast.com...
Sometimes, I wish that 100% meant 100% of the *page*, so If I set a <div> to height: 100%, it will span 100% of the page's height, regardless of whether the content does or not. That would make some things much easier.


Try looking at background attatchment. This might allow the background
images to "pretend" to be the full size by not moving when you scroll

http://www.w3.org/TR/CSS21/colors.ht...und-attachment

--
Martin Eyles
ma**********@NO SPAM.bytronic.c om
Dec 14 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
16122
by: lorelei | last post by:
Hey all, I have found two seperate HTML codes which claim to stop background images from being tiled. Neither of them seem to be working. I'm writing my codes in Textpad, and use Internet Explorer 6 for my browser. Below you will find the two codes I've found. Can anyone tell me why the hell they're not working?! This is driving me insane... moreso!!!!
27
13578
by: Kevin Yu | last post by:
When I declare on HTML page <LINK href="mycss.css" type="text/css" rel=stylesheet /> .... <BODY class=myclass> in mycss.css BODY { FONT-WEIGHT: bold; FONT-SIZE: 12px; FONT-FAMILY: Arial, Geneva; background-image: url(images/back.jpg); }
8
3770
by: Ron Holmes | last post by:
I want to place a background image on a windows form. Is there a way to prevent the image from Tiling without using an image box resized to the size of the form? I am using Visual Studio 2003 .NET. This is an easy thing to do in VB6.
3
9392
by: Sridhar | last post by:
Hi, I have created a user control which has the html code as follows <TABLE id="ToolBarTable" cellSpacing="0" cellPadding="0" width="100%" border="0"> <tr> <td align="right" bgColor="#000000"><IMG src="../Images/image1"> </td> </tr> <TR>
16
14627
by: Walker | last post by:
I have a span containing two words. Eg. <span>Avant Garde</span> Using CSS, I pad the text to the right and assign a background-image. Eg. span { padding: 0 3px 0 11px; background: url(images/tagbull.gif) no-repeat 0px 2px; }
2
2859
by: bissatch | last post by:
Hi, I am running a w3c CSS validation check on a site in development. I have many errors saying that my CSS is not valid because I have not defined the background-color but instead left it default transparent. Why does it require that every CSS defined element have their background-color defined? Also, when I set styles in the following way:
0
1244
by: kirby.urner | last post by:
Probably a fault line or cultural divide between acutely differing schools of thought, is in this area of tiling or mosaic making. Some schools consider this a stupid waste of time, others a core topic, whereas a 3rd group stays more neutral on the issue, and a tiny 4th group has no idea what I'm talking about. I'm in the second group (core topic) as tiling is to spacefilling as figurate are to polyhedral numbers. We may start in a...
7
2226
by: Nik Coughlin | last post by:
One thing that has always annoyed me, and I just design around it, is having a tile that you want to use for your background image that doesn't seamlessly tile, in a container that you want to be fluid. I had a go at it, but had to use JavaScript: http://nrkn.com/fluidTiling/ Question, anyone have *any* ideas about how you could do it without the JS?
4
5746
by: Bob Altman | last post by:
Hi all, I posted an earlier question to the microsoft.public.inetserver.asp.general newsgroup asking how to set the background of a client-side table cell to a gradient, and I received this answer: How do I stretch the static image? The Style property builder for a table cell lets me specify the background image location, tiling, scrolling, and position. But I can't find any obvious way to tell it to stretch the image
0
8917
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9281
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9200
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9142
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.