PC Review


Reply
Thread Tools Rate Thread

center floating text box on page

 
 
Joel
Guest
Posts: n/a
 
      23rd Feb 2010
is there a way to center a floating text box on a page so it stays centered
no matter what the browser resolution is? Is seems that I can only set
absolute position and and want the text box to be centered on the page no
matter what resolution or window size.

tia,

joel
 
Reply With Quote
 
 
 
 
Ronx
Guest
Posts: n/a
 
      24th Feb 2010
To centre an HTML element you need three things:

1) A complete and valid doctype

2) Left and right margins set to auto

3) A fixed width for the element

An example is at
http://www.rxs-enterprises.org/tests...nter_para.html

Note that if you use Absolute Positioning for a container that contains text, the page WILL break when a user resizes the text.
If you knew all about absolute positioning, you would avoid it.

What do you mean by Text-Box? If this is the text box produced from the Drawing tool bar, then avoid that as well. It uses VML graphics in IE, and a picture of the contents in other browsers.
See http://wwww.rxs-enterprises.org/fp/a...-graphics.aspx for more details.
--
Ron Symonds
Microsoft MVP (Expression Web)
http://www.rxs-enterprises.org/fp/wf-menu.aspx




Joel submitted this idea :
> is there a way to center a floating text box on
> a page so it stays centered no matter what the
> browser resolution is? Is seems that I can
> only set absolute position and and want the
> text box to be centered on the page no matter
> what resolution or window size.


> tia,


> joel


--
Ron Symonds
Microsoft MVP (Expression Web)
http://www.rxs-enterprises.org/fp/wf-menu.aspx


 
Reply With Quote
 
Hot-text
Guest
Posts: n/a
 
      24th Feb 2010
Yes you can! But Joel need to see the Code you working with to help you!

// a JavaScript alert text box

<SCRIPT language=JavaScript type=text/javascript>
<!--
//hide from old browsers
alert('there a way to \n ©center© \n a floating text box \n on a page \n
so it stays centered')
// -->
</SCRIPT>

//A floating text box marquee

<script language="JavaScript">
<!-- Begin
mesg = "The JavaScript Source, another marvelous use of bandwidth!";
isNS = (navigator.appName == "Netscape");
isIE = (navigator.appName == "Microsoft Internet Explorer");
text = ("<i><font size=2>"+mesg+"</font></i>");
if (isNS) {
document.write("<blink>" + text + "</blink>");}
else if (isIE) {
document.write("<marquee behavior=alternate direction=right>" + text +
"</marquee>");}
// End -->
</script>
<noscript>
<i><font size=2>The JavaScript Source, another marvelous use of
bandwidth!</font></i>
</noscript>





"Joel" <(E-Mail Removed)> wrote in message
news:9D263A88-8293-44A6-BF1E-(E-Mail Removed)...
> is there a way to center a floating text box on a page so it stays
> centered
> no matter what the browser resolution is? Is seems that I can only set
> absolute position and and want the text box to be centered on the page no
> matter what resolution or window size.
>
> tia,
>
> joel


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Center the text down the page Mel Microsoft Word New Users 4 3rd Aug 2008 10:50 PM
Placing text in the center of the page =?Utf-8?B?cG1jZ2ltcHNleQ==?= Microsoft Word New Users 4 6th Oct 2006 10:17 AM
want text to remain in center of page when typing document =?Utf-8?B?Y2FuZHlnaXJs?= Microsoft Word New Users 3 29th Dec 2005 01:46 AM
page/text is off center =?Utf-8?B?d2VuZHk=?= Microsoft Word Document Management 1 11th Feb 2005 03:33 AM
Text to remain in center of page Bruce Challoner Microsoft Word New Users 1 21st Jun 2004 08:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:11 PM.