473,756 Members | 5,156 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Repeat background no way to auto size

Hi all,

I posted a question about a side navigation bar earlier where I was
encountering this problem. I thought I'd repost the question in a more
general format because I'm not sure people quite understood what I was
asking in my last post. Here is what I'd like to do:

1. Have a div tag that's soul purpose is to display a repeating background
image in the y-axis.
2. The div tag should also have a fixed width.
3. The div tag should start from a specific point from the top of the
browser window.
4. The div tag should streach all the way to the bottom of the page no
matter how the user resizes the window.

Here is the style sheet code that I've come up with so far:

div#side_naviga tion_2 {
margin: 0px;
padding: 0px;
position: absolute;
left: 0px;
top: 368px;
right: auto;
bottom: 0px;
width: 224px;
height: auto;
background-image: url(../imgs/framework/side_nav/side_nav_backgr ound.jpg);
background-repeat: repeat-y;
}

The problem is that if you have height set to auto browsers won't display
the div unless it has some sort of content. I thought about just putting a
  in the div but this simply leads the browser to set the height equal
to one line of text. I can't seem to find a way to automatically calculate
the height of the window and have the div ajust accordingly.

Also it would seem to me that if you define left, top and bottom you would
end up with what I want. A repeating background that starts at X number of
pixels from the top, X number of pixels from the left (in my case 0px) and
0px from the bottom. Plus a fixed width but this just doesn't seem to work
as without defining a height the browser won't display the background image.

I hope that someone else out there has had this issue with style sheets and
has come up with a solution.

Regards,
Theo
Jul 20 '05 #1
1 6457
Theodore A. Jencks wrote:
1. Have a div tag that's soul purpose
That's kinda funky. (SCNR)
is to display a repeating background
image in the y-axis.
2. The div tag should also have a fixed width.
3. The div tag should start from a specific point from the top of the
browser window.
4. The div tag should streach all the way to the bottom of the page no
matter how the user resizes the window.
Why do you need the extra div element? Can you attach the bg image to
the body?
div#side_naviga tion_2 {
position: absolute;
left: 0px;
top: 368px;
bottom: 0px;
width: 224px;
height: auto;


Try height: 100%;
Note that you may need to set height: 100% for body, too, to get this to
work in certain browsers.

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #2

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

Similar topics

7
2213
by: barry womb | last post by:
Hello- I've created a page and have a table with a no repeating background. Works in all but Opera. Any ideas? Here's the style sheet: ..tdnavbg { background-color: #000000; background-image: url(images/nav_bg.gif);
1
2293
by: CMAR | last post by:
I have a design of a frameless page on my practice website: http://home.ne.rr.com/thespar/designerN.htm The idea is to have a #left navigation bar which is absolutely positioned and which contains a series of vertical placed unordered lists of links. To the right of the #left navigation bar is the #content section. I want the background in the #left section to extend to the bottom of the browser window.
1
1648
by: michael | last post by:
Below dropmenu and javascript modifies ul properties depending on if a link within matches the current url. If a match is found the .high style applies to the relevant section, or .low if no match is found. This works only for static list, or in the case of a dropmenu, with the first visible link of each UL only, as tested on Konqueror and Mozilla. When "position: absolute" is used in conjuction with removing the items from
14
7396
by: arteccentrix | last post by:
Please bear with me as I am new to both Firefox and CSS. I have browsed through a number of groups looking for similar problems to my own but can't find a definitive answer. If anyone here can help me out I would appreciate your shared expertise so much. My background image is displaying fine in IE, and, sometimes in Firefox until I hit the reload button. It seems as if the browser is unable to locate the image and throws up a graphic...
2
2975
by: darkpowrjd | last post by:
I've been trying to create a new navigation system for my site, and I got everything figured out except for one thing. Here is the CSS code I'm using right now: body { font: normal 10px Verdana, Arial, Helvetica, sans-serif; color: #000000; background: #FFFFFF; height: auto; width: auto; margin: 0px; padding: 0px;
1
2022
by: nicky77 | last post by:
hi there, i'm pretty inexperienced with CSS, so apologies for the shoddy coding. i'm trying to set a 3 column layout using different background images for each column. however, i have whitespace at the top and sides of the page, which i really want to get rid of. i've used nested divs to create the layout so hopefully i've set these up properly. the other problem i am having is that i want the images to repeat vertically to 100% of the page...
5
2174
by: Dave Siegel | last post by:
I'm trying to get the content window to go untill the top of the page, no matter what browser you're using. But untill now it only repeats with the text, but doesn't get to the bottom of the browser : http://theclan-name.com/school/games/index.html Here's my css : body { background: #2b2b2b url(img/bg_image.gif) no-repeat top center; font-family:Verdana, Arial, Helvetica, sans-serif;
11
2102
by: quartzy | last post by:
I am trying to set up an elastic layout with a background colour, then the body centred. But it is not working in the browsers. Here is the HTML and CSS, it looks OK to me but I must be doing something wrong. CSS #container { position: relative; width: 40em; background-color: #E60073; margin-left: auto; margin-right: auto;
2
4807
XedinUnknown
by: XedinUnknown | last post by:
Hi! I am new to this forum, but not new to web design and programming. Nevertheless, I have never tried to use PNG so extensively in my pages. here's the problem. First, I have found that the PNG backgrounds and images had no transparency and grey around them when viewed in IE6, but I solved this bug using this hack. It works great, but then another problem came up: a background image that had the solution applied to was not repeating...
0
9462
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
10046
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
9886
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...
0
9722
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
7259
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
6542
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
5155
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...
0
5318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3817
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.