navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

dynamic image with CSS

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Cascading Style Sheets >> dynamic image with CSS
Page: [1]
 
stall

 

Posts: 17
Joined: 2/14/2007
Status: offline

 
dynamic image with CSS - 3/19/2007 3:12:25   
Hello, i'm trying to make a fullscreen website, so many things must be a different size depending on the resolution and monitor size of people who visit the site.

So far I got the borders appearing properly but I can't seem to get the menu bar to appear properly.

Here is the code i'm using. Or just visit the site: http://eagl3s.kicks-ass.net. The menu bar is the "navLeft navRight and navMid" divs.

html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="css/main.css" type="text/css" rel="stylesheet" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<div class="leftBorder">
<div class="rightBorder">
<div class="banner">
</div> <!-- "banner" -->
<div class="menu">
  <div class="navLeft">
  <div class="navMid">
  <div class="navRight">  
    <ul id="nav">
	  <li><a href="http://www.eagl3s.kicks-ass.net" id="home">Home<span></span></a></li>
	  <li><a href="www.sex.com" id="members">Members<span></span></a></li>
	  <li><a href="http://www.eagl3s.kicks-ass.net/forum/index.php" id="forum">Forum<span></span></a></li>
	  <li><a href="http://www.eagl3s-clan.com" id="aokaoc">Aok-Aoc<span></span></a></li>
    </ul>
  </div>  <!--"navLeft"-->  
  </div>  <!--"navMid"-->
  </div>  <!--"navRight"-->
</div>

</div> <!-- "rightBorder" -->
</div> <!-- "leftBorder" -->
</body>
</html>



CSS:
body {
	margin: 0;
	padding: 0;
	background-image: url("../images/bg.gif");
	background-repeat: repeat;
}

.leftBorder {
 	background-image: url("../images/bdr.gif");
	background-repeat: repeat-y; 
	background-position: left top;
}

.rightBorder {
 	background-image: url("../images/bdr.gif");
	background-repeat: repeat-y; 
	background-position: right top;	
}

.banner {
	background-image: url("../images/banner.gif");
	margin: 0 auto;
	width: 943px;
	height: 161px;
}

.navLeft {
	background-image: url("../images/nav_01.gif");
	width: 73px;
	height: 55px;
}

.navMid {
	background-image: url("../images/nav_02.gif");
	background-repeat: repeat;
	background-position: center;
	height: 55px;
}

.navRight {
	display: inline;
	background-image: url("../images/nav_03.gif");
	margin: 0 auto;
	width: 73px;
	height: 55px;
}
	
.menu {
	height: 64px;
	width: 941px;
	margin: 0 auto;
	margin-bottom: 10px;
	line-height: 31px;
	text-align: center;
}


Tailslide

 

Posts: 5912
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: dynamic image with CSS - 3/19/2007 5:22:32   
Don't give your menu a width. Make the margins left and right in the menu the size of the borders so that it will hold it off each side.

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to stall)
stall

 

Posts: 17
Joined: 2/14/2007
Status: offline

 
RE: dynamic image with CSS - 3/19/2007 17:47:48   
I tried it and fiddled with display: but the images insist on being placed below eachother. Is there a bug in CSS when you try to use say "background-position: right;" within borders positioned with background-position as mine are?

(in reply to Tailslide)
Tailslide

 

Posts: 5912
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: dynamic image with CSS - 3/20/2007 3:01:32   
There's no such rule as background-position:right;

Have a look at this tutorial about background images: http://www.cssbasics.com/chapter_12_css_backgrounds.html and see if that helps.

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to stall)
stall

 

Posts: 17
Joined: 2/14/2007
Status: offline

 
RE: dynamic image with CSS - 3/20/2007 5:32:51   
Oh... yes that did help. Thanks for being an expert and guiding me on my way :D

(in reply to Tailslide)
jaybee

 

Posts: 13957
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: dynamic image with CSS - 3/20/2007 5:57:12   
Ssssssshh don't say things like that, we'll never hear the last of it. :)

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to stall)
Tailslide

 

Posts: 5912
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: dynamic image with CSS - 3/20/2007 6:05:46   
:)

Frankly, there's very few experts at CSS (I'm not one of them) - most of use who use it a lot just muddle our way through and then repeat the successful tactics.

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to jaybee)
happyhelper

 

Posts: 1
Joined: 4/20/2007
Status: offline

 
RE: dynamic image with CSS - 4/20/2007 16:46:16   
Unfortunately "There's no such rule as background-position:right;" is incorrect. Please see the W3C CSS standard at the following location: http://www.w3.org/TR/css3-background/#the-background-position

(in reply to Tailslide)
jaybee

 

Posts: 13957
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: dynamic image with CSS - 4/20/2007 17:58:30   
Thanks for that Happy Helper but that's CSS3. CSS3 is not yet released and the only browser supporting it to any extent is Opera.

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to happyhelper)
Tailslide

 

Posts: 5912
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: dynamic image with CSS - 4/21/2007 3:27:23   
Yeah which given the browser support of CSS2, CSS3 might just be fully supported by about 2020!

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to jaybee)
jaybee

 

Posts: 13957
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: dynamic image with CSS - 4/21/2007 5:25:00   
That soon? :)

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to Tailslide)
Tailslide

 

Posts: 5912
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: dynamic image with CSS - 4/21/2007 5:34:11   
Actually I think Marcus is right and I was wrong - you can use a single value in the background-position in CSS2 - it will be assumed to be the horizontal position and the vertical will be assumed to be 50%.

My view on this (and the reason I've never used a single value ) is that I don't trust it to do what it's told in all browsers and so I'd always add in both values. It also allows less room for confusion as to which value you're declaring - horizontal or vertical (maybe it's just me that always gets them round the wrong way?)

http://www.w3.org/TR/CSS21/colors.html#background-properties

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to jaybee)
jaybee

 

Posts: 13957
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: dynamic image with CSS - 4/21/2007 5:55:35   
quote:

maybe it's just me that always gets them round the wrong way?
Nope, not just you. It just doesn't seem logical.

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to Tailslide)
Ryokotsusai

 

Posts: 248
Joined: 10/5/2005
Status: offline

 
RE: dynamic image with CSS - 4/23/2007 7:20:00   
quote:

Don't give your menu a width. Make the margins left and right in the menu the size of the borders so that it will hold it off each side.


can this be used with height as well?

_____________________________

The world is more like it is now than it ever has been before.
--Dwight Eisenhower

(in reply to jaybee)
jaybee

 

Posts: 13957
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: dynamic image with CSS - 4/23/2007 8:43:07   
You can use top and bottom margins as well as left and right.

I rarely specify heights unless it's an image or I'm forced to for some other reason.

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to Ryokotsusai)
Page:   [1]

All Forums >> Web Development >> Cascading Style Sheets >> dynamic image with CSS
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts