473,765 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to line a box with thin border containing background image

Hi there,

I'm trying to create a containing box (relative position), and within
it, I'm trying to line that box with four (top, right, left, bottom)
thin boxes that contain a repeated background image, thus creating a
kind of fancy border. What would be the best practice to do that? I
thought that if the containor box was relative and the contained boxes
were absolute, that would work because the absolute boxes would be
measured againsted the containing box. But, it seems that each
subsequent box is measured off of the preceeding box, not the
containing one.

Here's what I get:

(the containing box, called calendar, is invisible)
||============= =========
||
||
||
|| <-----line should be here to make a box
||
||
||
||
||
||============= =========||
||
||
|| <------ this should be up above to make a box.
||
||
||
||
||
||

Here's the code:
HTML:
<div id="calendar">
<div id="top-border"/>
<div id="left-border"/>
<div id="bottom-border"/>
<div id="right-border"/>
</div>

CSS:
#calendar {
width: 1000px;
height: 887px;
margin-left: auto;
margin-right: auto;
margin: 0em;
padding: 0em;
position: relative;
border: 1px solid;
}

#top-border {
width: 100%;
background-image: url(images/bg_top.gif);
background-repeat: repeat-x;
height: 7px;
position: absolute;
top: 0em;
left: 0em;
}

#left-border {
background-image: url(images/bg_left.gif);
height: 887px;
width: 8px;
background-repeat: repeat-y;
position: absolute;
left: 0px;
top: 0px;
}

#right-border {
background-image: url(images/bg_right.gif);
height: 887px;
width: 8px;
background-repeat: repeat-y;
position: absolute;
right: 0px;
top: 0px;
}

#bottom-border {
width: 1000px;
background-image: url(images/bg_bottom.gif);
background-repeat: repeat-x;
height: 7px;
position: absolute;
bottom: 0px;
left: 0px;
}

Thanks in advance for your help.
Skeeve

Mar 16 '06 #1
0 1541

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

Similar topics

2
2686
by: Michael Winter | last post by:
I have the familiar 'thumbnail' scenario. I want to place a small border around the image when the cursor hovers above it. I use a 1 pixel, solid border around the image that changes between normal and hover. This works fine in Internet Explorer, but in Opera 7.22, the bottom border is 3 pixels thick. If I expand all borders to 3 pixels, this bottom border is still 2 pixels thicker than the others, which suggests that padding or a...
2
40637
by: Lars | last post by:
Hello all, Having googled around without any luck, I resort to posting my own question: Is there any way I can make a <div> adjust to the width of a contained image and line break any long text instead of expanding the <div>? The background of the problem is that I use a nested <div> to contain an image and its caption. I float the entire <div> to the right in its containing <div>.
6
2458
by: Alan J. Flavell | last post by:
The page under discussion was http://ppewww.ph.gla.ac.uk/~flavell/www/html-smac.html An email correspondent referred to the link text "screenshot" in part 2, which in his case was coming at the right-hand end of a line. As soon as he hovered over it in MSIE, it sprang to the next line - making it impossible to use it, obviously. This didn't happen in Mozilla (which by the way reports that this page is in standards-compliance mode, if...
12
1856
by: scott | last post by:
Is there a way to prevent IE from forcing a line break? Below in LISTING 2, you notice the table background image extention of '.jpg' begins a new line, instead of staying on the same line as it's file name. Same happens with my javascript onclick event, IE forces a line break and breaks my code. In my asp code, you notice I'm inserting line breaks, but IE seems to do what it wants. I should note, the below HTML results is actually 1 table...
3
1843
by: Pierre Jelenc | last post by:
I am trying to put a graphical border along the top, left, and right edges of a page. For left and top I have an oversize GIF with the proper graphics used as the background-image of either the body or an inside div. For the right, I tried a floated div of height: 100% and with the complementary right border as the background-image, and containing a 1-pixel high transparent GIF. This simplified example does not work: ...
2
2462
by: Daniel Kaplan | last post by:
First off thanks to those that helped me with my background image on a form, topic... "Manipulating a forms input border" I finally opted for spilting my image up into a table, and it pretty much stays the same even when Text is changed. Fortunatly it's a simple image, therefore it's ok. I have another question, I would like to divide items on my main viewport
2
4550
by: Skeeve | last post by:
Hi there, I'm trying to create a containing box (relative position), and within it, I'm trying to line that box with four (top, right, left, bottom) thin boxes that contain a repeated background image, thus creating a kind of fancy border. What would be the best practice to do that? I thought that if the containor box was relative and the contained boxes were absolute, that would work because the absolute boxes would be measured...
1
3887
by: mudasserrafiq | last post by:
I am using following asp file default.asp <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <META http-equiv=Content-Type content="text/html; charset=windows-1252"> <META content="0 Days" name=revisit-after> <META content=info@siderinternational.com name=email> <META content="Omer Safdar" name=author> <META content=MegaStudios.com name=publisher> <META content="Copyright ©2005 - MegaStudios.com" name=copyright> <SCRIPT...
0
2652
by: Berlin Brown | last post by:
I have two DIVs on the same line, a left navigation frame and the right content. I want both of those items on the same line. Lets say the left nav content is 140pixels and the right content is 1400 pixels. In internet explorer, if I put these together the right content is pushed below the left nav on a separate row. I want them on the same line. I guess I could use a table and that would fix it, but I don't have access to change the...
0
9399
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10163
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
10007
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
9835
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
7379
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
5276
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
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.