HighDots Forums  

moving div against edge of body tag

Javascript JavaScript language (comp.lang.javascript)


Discuss moving div against edge of body tag in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Netman
 
Posts: n/a

Default moving div against edge of body tag - 11-04-2009 , 03:46 PM






Hello!

Is it possible to move div against the edge of body tag?
I would like to have div located in the same place on every monitor
nevermind if it is high resolution or low and nevermind if it is panoramic
monitor or old ordinary crt monitor or notebook monitor

If so, please give me the example how to move div...

Thank you in advance
netman

Reply With Quote
  #2  
Old   
VK
 
Posts: n/a

Default Re: moving div against edge of body tag - 11-04-2009 , 05:06 PM






Netman wrote:
Quote:
Is it possible to move div against the edge of body tag?
I would like to have div located in the same place on every monitor
nevermind if it is high resolution or low and nevermind if it is panoramic
monitor or old ordinary crt monitor or notebook monitor
I assume that by "the edge of body tag" you assume top-left, top-
right, bottom-left and bottom-right corners of the body element so -
lesser some special layouts - top-left, top-right, bottom-left and
bottom-right corners of the browser display area. In this case you
don't need scripting right away, CSS would make it, say:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
HTML {
width: 100%;
height: 100%;
}
BODY {
width: 100%;
height: 100%;
}
DIV#MyDiv1 {
position: absolute;
left: 0; top: 0;
width: 10%; height: 5%;
background-color: yellow;
}
DIV#MyDiv2 {
position: absolute;
left: 90%; top: 0;
width: 10%; height: 5%;
background-color: yellow;
}
DIV#MyDiv3 {
position: absolute;
left: 0; top: 95%;
width: 10%; height: 5%;
background-color: yellow;
}
DIV#MyDiv4 {
position: absolute;
left: 90%; top: 95%;
width: 10%; height: 5%;
background-color: yellow;
}
</style>
</head>
<body>
<div id="MyDiv1">My DIV 1</div>
<div id="MyDiv2">My DIV 2</div>
<div id="MyDiv3">My DIV 3</div>
<div id="MyDiv4">My DIV 4</div>
</body>
</html>

It is just an idea, comp.infosystems.www.authoring.stylesheets
newsgroup may help you with the exact details. If you have further
questions about using CSS for your solution then please post in that
group. If you believe need an extra scripting then ask in this thread.

Reply With Quote
  #3  
Old   
SAM
 
Posts: n/a

Default Re: moving div against edge of body tag - 11-04-2009 , 09:44 PM



Le 11/4/09 9:46 PM, Netman a écrit :
Quote:
Hello!

Is it possible to move div against the edge of body tag?
I would like to have div located in the same place on every monitor
nevermind if it is high resolution or low and nevermind if it is panoramic
monitor or old ordinary crt monitor or notebook monitor
Can't you only use CSS ?

Quote:
If so, please give me the example how to move div...
A div in natural state has always its edges (left and right) against
those of the body.

What did you do to to that div (or to he body) if it'sn't edge to edge ?

More explanations are necessary about that div and its context.

--
sm

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

Default Re: moving div against edge of body tag - 11-05-2009 , 02:24 PM



Uzytkownik "SAM" <stephanemoriaux.NoAdmin (AT) wanadoo (DOT) fr.invalid> napisal w
wiadomosci news:4af23c09$0$955$ba4acef3 (AT) news (DOT) orange.fr...
Quote:
Le 11/4/09 9:46 PM, Netman a écrit :
Hello!

Is it possible to move div against the edge of body tag?
I would like to have div located in the same place on every monitor
nevermind if it is high resolution or low and nevermind if it is
panoramic monitor or old ordinary crt monitor or notebook monitor

Can't you only use CSS ?

If so, please give me the example how to move div...

A div in natural state has always its edges (left and right) against those
of the body.

What did you do to to that div (or to he body) if it'sn't edge to edge ?

More explanations are necessary about that div and its context.

--
sm
The content of div is flash or gif banner which has to be placed in the same
place on every kind of monitors.

nt.

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

Default Re: moving div against edge of body tag - 11-05-2009 , 07:35 PM



Le 11/5/09 8:24 PM, Netman a écrit :
Quote:
Uzytkownik "SAM" <stephanemoriaux.NoAdmin (AT) wanadoo (DOT) fr.invalid> napisal w
wiadomosci news:4af23c09$0$955$ba4acef3 (AT) news (DOT) orange.fr...
Le 11/4/09 9:46 PM, Netman a écrit :
Hello!

Is it possible to move div against the edge of body tag?
I would like to have div located in the same place on every monitor
nevermind if it is high resolution or low and nevermind if it is
panoramic monitor or old ordinary crt monitor or notebook monitor
Can't you only use CSS ?

The content of div is flash or gif banner which has to be placed in the same
place on every kind of monitors.
What the monitor has to do with the placement of a div in the body of
the document ?
(I expect you don't want the div at rear of the monitor ?)

Once more: where is supposed to be that div ?
- in another one ? styled ? how ?
- in top ? bottom ? of the body (in the html code)


css:
====
#baner { position: absolute; top: 0; left:0;
width: 300px; height: 200px; }
..option { width: 100% }

html:
=====
<body>
<h1>my title</h1>
<p>some content</p>

blah all the content


<img id="baner" class="option" src="advertising.php" alt="">
</body>


--
sm

Reply With Quote
  #6  
Old   
Osmo Saarikumpu
 
Posts: n/a

Default Re: moving div against edge of body tag - 11-06-2009 , 03:50 AM



SAM kirjoitti:

Quote:
#baner { position: absolute; top: 0; left:0;
width: 300px; height: 200px; }
..option { width: 100% }
The latter style rule is superfluous for:

Quote:
img id="baner" class="option" src="advertising.php" alt=""
The rule for id being more specific.

--
Best wishes,
Osmo

Reply With Quote
  #7  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: moving div against edge of body tag - 11-06-2009 , 06:16 AM



Osmo Saarikumpu wrote:

Quote:
SAM kirjoitti:

#baner { position: absolute; top: 0; left:0;
width: 300px; height: 200px; }
..option { width: 100% }

The latter style rule is superfluous for:
No, it is not.

Quote:
img id="baner" class="option" src="advertising.php" alt=""

The rule for id being more specific.
Perhaps that is the general idea?


PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16

Reply With Quote
  #8  
Old   
Captain Paralytic
 
Posts: n/a

Default Re: moving div against edge of body tag - 11-06-2009 , 09:33 AM



On 4 Nov, 20:46, "Netman" <net... (AT) poczta (DOT) onet.pl> wrote:
Quote:
Hello!

Is it possible to move div against the edge of body tag?
I would like to have div located in the same place on every monitor
nevermind if it is high resolution or low and nevermind if it is panoramic
monitor or old ordinary crt monitor or notebook monitor

If so, please give me the example how to move div...

Thank you in advance
netman
I'm afraid it is impossible. DIVs and indeed any other browser based
content (apart from maybe a javascript alert), can only remain within
the confines of the browser itself.

Reply With Quote
  #9  
Old   
Osmo Saarikumpu
 
Posts: n/a

Default Re: moving div against edge of body tag - 11-06-2009 , 09:45 AM



Thomas 'PointedEars' Lahn kirjoitti:
Quote:
Osmo Saarikumpu wrote:
SAM kirjoitti:
#baner { position: absolute; top: 0; left:0;
width: 300px; height: 200px; }
..option { width: 100% }

The latter style rule is superfluous for:

No, it is not.
I'm sure that you are right, I can't see why, though. I suspect that I
may have some kind of blind spot with selectors. I hope it's not
anything embarrassingly obvious

--
Nice weekend,
Osmo

Reply With Quote
  #10  
Old   
SAM
 
Posts: n/a

Default Re: moving div against edge of body tag - 11-06-2009 , 09:51 AM



Le 11/6/09 9:50 AM, Osmo Saarikumpu a écrit :
Quote:
SAM kirjoitti:

#baner { position: absolute; top: 0; left:0;
width: 300px; height: 200px; }
..option { width: 100% }
must read : .option (instead of ..option)

Quote:
The latter style rule is superfluous for:
As named ... it's an "option" ;-)

Quote:
img id="baner" class="option" src="advertising.php" alt=""

The rule for id being more specific.
And the class 'option' with/without can modify too
(without moving the div - object of the question)

--
sm

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 - 2009, Jelsoft Enterprises Ltd.