Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Css Positioning "Screen-Width-Relative"

Reply
Thread Tools

Css Positioning "Screen-Width-Relative"

 
 
Rob Powell
Guest
Posts: n/a
 
      09-17-2006

hi all

i was wondering

is there a way to give a CSS class a position screen-width-relative? ie,
can i have a class having some properties like "horizontal positioning =
(screen.width / 2) - 350"... ?

thanks in advance
rob
 
Reply With Quote
 
 
 
 
dorayme
Guest
Posts: n/a
 
      09-17-2006
In article <eei7oi$i1p$(E-Mail Removed)>,
Rob Powell <(E-Mail Removed)> wrote:

> hi all
>
> i was wondering
>
> is there a way to give a CSS class a position screen-width-relative? ie,
> can i have a class having some properties like "horizontal positioning =
> (screen.width / 2) - 350"... ?
>
> thanks in advance
> rob


You can position a box in a browser with CSS. But you need more
to instruct for the monitor itself. You may have some success
with javascript.

--
dorayme
 
Reply With Quote
 
 
 
 
Jonathan N. Little
Guest
Posts: n/a
 
      09-17-2006
Rob Powell wrote:
> hi all
>
> i was wondering
>
> is there a way to give a CSS class a position screen-width-relative? ie,
> can i have a class having some properties like "horizontal positioning =
> (screen.width / 2) - 350"... ?
>
> thanks in advance
> rob


Not directly, but this way will do it:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<style type="text/css">
#pushpin {
position: absolute; left: 50%; margin-left: -350px;
width: 10em; border: 1px solid black;
}
</style>
</head>
<body>

<div id="pushpin">Here I am!</div>
</body>
</html>




--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      09-17-2006
Rob Powell wrote:
> is there a way to give a CSS class a position screen-width-relative?


Why? That's just going to be horrible for anyone who doesn't run their
browser maximised.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      09-17-2006
In article <eejarl$i0o$1$(E-Mail Removed)>,
David Dorward <(E-Mail Removed)> wrote:

> Rob Powell wrote:
> > is there a way to give a CSS class a position screen-width-relative?

>
> Why? That's just going to be horrible for anyone who doesn't run their
> browser maximised.


Yes, I was wondering about this. (JL's answer to OP seemed
intriguingly clever).

--
dorayme
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Datalist and CSS positioning Eric ASP .Net 1 09-14-2005 03:38 PM
OT ...CSS positioning ASP .Net 1 04-07-2004 12:58 PM
Re: CSS positioning help - Mozilla brucie HTML 8 06-29-2003 05:39 PM
Re: CSS positioning help - Mozilla David Graham HTML 1 06-28-2003 05:15 PM
Re: css positioning vs. tables PeterMcC HTML 0 06-23-2003 04:45 PM



Advertisments