Programming Forums
User Name Password Register

RSS Feed

Thread Tools Display Modes
Old Jun 24th, 2009, 8:56 PM   #1
Hobbyist Programmer
Join Date: Dec 2006
Posts: 119
Rep Power: 11 csrocker101 is on a distinguished road
Text moving on a browser minimize

Hey everyone. Just have another question. I'm new to this whole HTML thing but have run into another problem. Whenever I re-size the browser the text is moving. The site is very simple so far:

<body class="body">
    <form id="form1" runat="server">
     <div class="main">
       <div class="intro">
        <p class="text">Hello Welcome to my site. I finally made one of these
        becasue I'm that cool. </p>

My css:

	 background-image: url("images/background.jpg");
	 background-position: center;

The text I have in my HTML looks great when the browser is maximized. But if you re size the browser or minimize it the text moves from it's correct place and is "pushed down" so to speak. How do you make the text be in the same spot regardless of the browser window being minimized or maximized?
csrocker101 is offline   Reply With Quote
Old Jun 27th, 2009, 6:43 AM   #2
Professional Programmer
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 446
Rep Power: 13 mackenga is on a distinguished road
Re: Text moving on a browser minimize

Not sure if this helps, but I did a quick search and turned up:

which is about creating fixed widths with CSS (but I didn't read it in any depth or try it out so I'm not sure whether it will really fix the width or just set a maximum, sorry, I'm too lazy ).

I would generally advise against this sort of trickery on the web though. It's usually a bad idea to try to do fixed positioning and fixed widths. Consider that if you don't want your text to wrap when the browser window is too narrow, what you're really saying is that where the window is too narrow, you want to force the user to scroll. If the user has a narrow screen he or she will not like that.

Some might argue that these days most people do not have narrow screens, but it's not just users of older hardware that might. It's also users of netbooks, mobile browsers and users with poor eyesight who need to scale up objects and text displayed on their computers so that they can see them clearly. Forcing these users to scroll will tend to encourage them just to stop using your site.

It's better to try to write your HTML and CSS such that it renders well or at least acceptably on a range of browsers and screen geometries. Obviously when you're just starting out, this doesn't matter so much, but it's always good to get into good habits.
"There is no absolute knowledge, and those who claim it, whether they are scientists or dogmatists, open the door to tragedy" -- Jacob Bronowski
mackenga is offline   Reply With Quote
Old Jul 12th, 2009, 2:22 AM   #3
13 Year Old Web Designer!
Sodin's Avatar
Join Date: Jul 2009
Posts: 9
Rep Power: 0 Sodin is on a distinguished road
Re: Text moving on a browser minimize

umm it looks to me that it is the

and should be


"left" means how many pixels from the left you want to position it. "top" is how many pixels you want to position text from the top. also after the number of pixals always put "px" which obviously means pixels. good luck!
Sodin is offline   Reply With Quote


« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Special browser in Java (Project) stalefish Java 3 Feb 9th, 2008 5:22 PM
How to detect cursor location and insert text??? syntax-error C# 3 Jun 30th, 2005 2:42 AM
Printing rich text with colored background jarrod C# 1 Feb 23rd, 2005 12:48 PM
CSS and Browser Text Size settings wright45 HTML / XHTML / CSS 6 Feb 11th, 2005 12:08 PM

DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:28 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC