I am learning PHP and CSS and I have a very basic CSS layout right now that just centers everything for me, but my problem is that I gave my text certain values and well it does not work when I use "echo". The only way I can get it to work is by putting a <p> </p> tag within the echo statement. How do I get around this? Thanks
It sort of depends on what you mean by "it does not work". If for example you've styled the "p" tag in your CSS, but then you output text not enclosed with <p> ..... </p> and are concerned that your styling is not being applied, then yes that's correct. The solution to that is probably to just output the <p> tags with your echo. On the other hand, say you styled the <body> tag in your CSS, with various default font styles, then these styles should cascade down to your text and provide styling regardless of whether you surrounded it with <p> tags or not. Most often though, when I'm using the <p>aragraph tag, I need to style it specifically with things like margins and such, which wouldn't be doable just by styling <body> or some <div> you're in.