Formatting with html/php

slugger_2003

Limp Gawd
Joined
Jan 30, 2007
Messages
365
Hey all. I'm new to web programming and have just started a course in dynamic websites.
Can anybody steer me in the direction of a useful resource on how to format text? I've been trying to implement tabbing using "\t" but apparently even though the code is tagged as php, HTML does not like this?? So I've come across the following code:

<p style="margin-left: 3em;">Sample text<br/><br/></p>

This works ok but it doesn't scale when I maximise the window...
I'm sure you get the simplistic nature of my question :)

Any comments appreciated, thanks.
 
Looks like your on the right track. Setting the style attribute on a tag invokes CSS properties for formatting etc. If you haven't learned CSS, teach yourself! http://www.w3schools.com/ is an excellent place to learn. They are also incidentally the people who define HTML.



The <pre> tag might come in handy.
 
Hey there. May I suggest you head on over to www.w3schools.com if you haven't already. The (X)HTML and CSS starters are great.

Now to answer your question. Though the <br /> tag exists (break line), you really shouldn't use it (Seperate Design from Structure!).

You may accomplish what you're looking for by adding a bottom margin to your CSS:
Code:
<p style="margin-left: 3em; margin-bottom: 2em;">Sample text</p>

Though in a real world situation you may end up referencing a stylesheet instead of inline.


Good Luck!

EDIT: Beat to the punch!
 
HTML discards all tabs and newlines (except in <pre> blocks); you're headed in the right direction. Look into a decent CSS guide.
 
Back
Top