HighDots Forums  

background border on right and left

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss background border on right and left in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mary Ellen Curtin
 
Posts: n/a

Default background border on right and left - 09-05-2003 , 05:38 PM






The client wants the page to have both a left border (purple) and a right
border (green).
Is there any way to stretch a background image to fit the viewport? Or
should I divide
the background into columns, each a different color?

Mary Ellen
Doctor Science, MA



Reply With Quote
  #2  
Old   
Mary Ellen Curtin
 
Posts: n/a

Default Re: background border on right and left - 09-05-2003 , 11:37 PM






Brian wrote:
Quote:
body {
border-left: thin solid #909 ;
border-right: thin solid #090 ;
}
I was unclear. By "border" I meant the sort of border+background you see
here:
http://www.pambytes.com/borders/paper/index1.html
(example chosen by random googling). The client wants quite a wide colored
band
running down each side of the viewport.

Quote:
Erm, why would you use an image for borders?
Because they want something wide (and later I suspect they will want
textures, etc.). Also,
IE5.5 (at least) puts a body border (as in your example) outside the scroll
bar.

While googling I found this example:
http://www.bigbaer.com/css_tutorials...css.template.h
tm

and am looking at the code in the hopes I can alter it to be useful.

Mary Ellen
Doctor Science, MA




Reply With Quote
  #3  
Old   
Mary Ellen Curtin
 
Posts: n/a

Default Re: background border on right and left - 09-06-2003 , 11:58 AM



Replying to myself, I've put *something* together here:

http://www.alternateuniverses.com/test/anetry.html

Do I need to use a box hack on my "main" division to get it to go up to the
top of the screen
in IE6.0? It looks just right in IE5.5.

Mary Ellen
Doctor Science, MA



Reply With Quote
  #4  
Old   
SantaKlauss
 
Posts: n/a

Default Re: background border on right and left - 09-07-2003 , 05:40 AM



Mary Ellen Curtin wrote:
Quote:
The client wants the page to have both a left border (purple) and a right
border (green).
Is there any way to stretch a background image to fit the viewport? Or
should I divide
the background into columns, each a different color?
Hi Mary, an easy solution could be this if you have to use
graphics borders. CSS part:

<style type="text/css">

html, html>body{
height: 100%;
/*just added for testing purpose even with blank page in
Opera and Mozilla, remove it when you've filled up the page*/
}

body{
background: url("leftborder.gif") top left repeat-y
}

div#main{
background: url("rightborder.gif") top right repeat-y;
margin: 0 100px;
}

</style>

and in the html:

<body>
<div id="main">
<!-- put all content here -->
</div>
</body>

Note the right and left margin should have at least same width
of the background images.

HTH,
SantaKlauss




Reply With Quote
  #5  
Old   
SantaKlauss
 
Posts: n/a

Default Re: background border on right and left - 09-07-2003 , 11:01 AM



Hi Mary,
just a little thing to add: if you want the body background-color to
be set, and I suppose you would, just have to add the color in the body
background shorthand and leave the main content with transparent
background, like this:

body{
background: #69C url("leftborder.gif") top left repeat-y
}

div#main{
background: transparent url("rightborder.gif") top right repeat-y;
margin: 0 100px
}

HTH,
SantaKlauss



Reply With Quote
  #6  
Old   
SantaKlauss
 
Posts: n/a

Default Re: background border on right and left - 09-08-2003 , 12:32 AM



Ooops, sorry: have to use padding instead of margin.

body{
background: #69C url("leftborder.gif") top left repeat-y
}

div#main{
background: transparent url("rightborder.gif") top right repeat-y;
padding: 0 100px
}

*<|:-)
SantaKlauss



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.