Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > css bottom && center

Reply
Thread Tools

css bottom && center

 
 
Jan Faerber
Guest
Posts: n/a
 
      03-13-2005
With Mozilla

a)
<div style="position:absolute; top:80%; text-align:center"><a
href="...">------</a></div>
looks like

|--------------------------------------------|
| |
| |
| |
| |
| |
| ------ |
| |
|--------------------------------------------|

b)
<div style="text-align:center"><a href="...">------</a></div>
looks like

|--------------------------------------------|
| ------ |
| |
| |
| |
| |
| |
| |
|--------------------------------------------|

c)
What can I do that it looks like this when a) does not work?

|--------------------------------------------|
| |
| |
| |
| |
| |
| |
| ------ |
|--------------------------------------------|



--
Jan

http://www.h-tut.at
 
Reply With Quote
 
 
 
 
Lauri Raittila
Guest
Posts: n/a
 
      03-13-2005
in alt.html, Jan Faerber wrote:
> With Mozilla
>
> a)
> <div style="position:absolute; top:80%; text-align:center"><a
> href="...">------</a></div>
> looks like


[ASCII snipped, wants to have centered vertically]

Add
width: 100%;
or
left:0;right:0;


--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Utrecht, NL.
 
Reply With Quote
 
 
 
 
Jonathan N. Little
Guest
Posts: n/a
 
      03-13-2005
Jan Faerber wrote:

<snip>
> c)
> What can I do that it looks like this when a) does not work?
>
> |--------------------------------------------|
> | |
> | |
> | |
> | |
> | |
> | |
> | ------ |
> |--------------------------------------------|
>
>
>

To get (c) add 'width' to your divider like:

<div style="position:absolute; top:80%; text-align:center WIDTH: 100%"><a
href="...">------</a></div>

else your link will be centered with a DIV, but the DIV is only as wide
it needs to be, if you had added a border to your DIV it would have
looked like:
|--------------------------------------------|
| |
| |
| |
| |
| |
|+------+ |
||------| |
|+------+ |
|--------------------------------------------|

shows that the link is indeed centered within the DIV but nothing is
defined to center the DIV within its container...
or of course your could have the container, in this case the BODY center
its contents, but I do not think that is what you intended.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Jan Faerber
Guest
Posts: n/a
 
      03-14-2005
Lauri Raittila ... output:

> in alt.html, Jan Faerber wrote:
>> With Mozilla
>>
>> a)
>> <div style="position:absolute; top:80%; text-align:center"><a
>> href="...">------</a></div>
>> looks like

>
> [ASCII snipped, wants to have centered vertically]


Why vertically?

> Add
> width: 100%;
> or
> left:0;right:0;


Yes, this works - thank you! (:
I understand - the div section has to be made wider.



--
Jan

http://www.h-tut.at
 
Reply With Quote
 
Jan Faerber
Guest
Posts: n/a
 
      03-14-2005
Jonathan N. Little ... output:


> shows that the link is indeed centered within the DIV but nothing is
> defined to center the DIV within its container...
> or of course your could have the container, in this case the BODY center
> its contents, but I do not think that is what you intended.


Thank you for this explaination!
I don't know why it was not clear to me before but now I think I can predict
the behaviour of a browser much better.



--
Jan

http://www.h-tut.at
 
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
css "div" bottom of window or bottom of content. Dan HTML 1 04-04-2008 09:40 AM
How do we know the memory arrangement using in microprocessors? Top-Bottom or Bottom-Top? Cuthbert C Programming 8 09-13-2006 12:09 PM
CSS to put text at bottom of browser window, or page bottom, whichever is lower? Noozer HTML 1 03-13-2006 10:35 AM
center text at bottom of screen acorn71@gmail.com HTML 17 12-01-2005 07:29 PM
Naming of core NASA center with the words "Mission Control Center" & mass use of religious anthem sounding word "Mission" in Context of Space Exploration & the Moon Landing Hoax moonlandinghoaxreligious@yahoo.com Digital Photography 0 09-27-2005 08:28 PM



Advertisments