www.webdeveloper.com
Results 1 to 2 of 2

Thread: PHP and CSS

  1. #1
    Join Date
    Feb 2004
    Location
    Florida
    Posts
    24

    PHP and CSS

    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

  2. #2
    Join Date
    Aug 2006
    Posts
    1,886
    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.

    Dave

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles