• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

best way to position text in HTML page

 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
What is the est way to position text in HTML, so it can work with any screen resolution,
I haev tried <div> which adds a line break , and <span> it works okay
but is it the right tool for position text (using <span style="left: 30%; position: relative; "> tag)
I use to use tables to do this, ut has to be a better way i guess
for example i want to display some text inline as below
the requirement is that the distance between them stays when i change screen resolution
PO Number : 100000122 Date: 27/10/03 Amount: 1222.00 USD
I tried this as below
<span class="style" id="po">Purchase Order Number : </span>10000122 <span class="style" style="left: 10%; position: relative; ">Date :</span> <span style="left: 15%; position: relative; "> 27/10/03 </span> <span class="style" style="left: 25%; position: relative; " >Total Amount :</span> <span style="left: 30%; position: relative; ">7,250.00 GBP</span>

I guess this is lot of coding to achieve it,
Any help

Ashish
 
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're concerned about the amount of code, I'd put something like this in your <style> tag or an external stylesheet:



Then you don't have to set the style inline for each SPAN. And for future reference, if you don't want a DIV to move to a new line, you can set style="display:inline;"
 
reply
    Bookmark Topic Watch Topic
  • New Topic