• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

best way to position text in HTML page

 
ashish kulkarni
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • 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
 
Garann Means
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • 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;"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic