Honesty Rocks! truth rules.

Problem Getting Text To Align With Different Resolutions

HOME      >>       Programming


Hey! I just like fiddling around with making websites, and I'm working on one at the moment.However, while I can the text box to align on the designated area on the background image on my monitor, I'm well aware that with other resolutions and web browsers, it doesn't. (I use Firefox)A buddy told me to looks up some CSS but I'm not very good with it at all. What do I need to do to get it to centre regardless of the screen resolution the viewer uses?The website is optimized for 1280x1024 resolution in Firefox.


What u can do is to place that in the center is use tables. Tables are the best way to align things on your page if you are rendering pages without using CSS. On the other hand if are to keep making web pages you must learn CSS it very simple and it will make your work very simple and reduce the length of code u write in the HTML pages. In CSS u can write patterns and styles for more tha n one pages...that is you can have aCSS file for your entire website that is for all the pages as mostly all pages of a website use a common type of styling..So for u best option is to learn CSS,Yes there are other tools which can help u making webpages like dreamweaver and coffeecup.


If you want to go with CSS I'd recommend putting your text box in an absolute div layer and centering that. Something like this should do the trick:

<div style="position:absolute;left:50%;top:50%;margin-left:-100px;width:200px;margin-top:-50px;height:100px">


Why not google for W3Schools and learn some CSS basics over there?Then, you'll be able to go over to google again and search for specific details on how to align things the way you want them to be aligned. I'm not trying to simply redirect you to another place, I'm just encouraging you to discover CSS for yourself... for example, you'd be able to quickly grasp the code galexcd left there ;)Using tables is not encouraged as it is semantically incorrect (besides other things).galexcd's suggestion is correct, by the way... But it will only render correctly if the page is on Standards-Compliance mode... So, try to go with standards compliant code, or else the page may become a mess :)


can you provide a link to the page and the code snippets you are asking about?Html and css, both, please.