9 Replies - 1773 Views - Last Post: 13 June 2005 - 09:24 PM Rate Topic: -----

#1 nascent  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 11-June 05

PHP and CSS

Posted 12 June 2005 - 07:00 PM

Is it possible to output data directly to css tags in some way rather than to a table?

For example can output be sent to <div id="main"> rather than to <td>, <br> or <p> type tags?


Thanks <smiles>
nascent
(still super clueless newbie)
Is This A Good Question/Topic? 0
  • +

Replies To: PHP and CSS

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,507
  • Joined: 12-July 02

Re: PHP and CSS

Posted 12 June 2005 - 08:22 PM

Do you mean out put data derived from ascript, or obtained from a database? Data can be output anywhere...td,br (this is actually just a line break), and p tags are merely used for formatting.
Was This Post Helpful? 0
  • +
  • -

#3 nascent  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 11-June 05

Re: PHP and CSS

Posted 13 June 2005 - 10:41 AM

Amadeus, on Jun 12 2005, 08:22 PM, said:

Do you mean out put data derived from ascript, or obtained from a database? Data can be output anywhere...td,br (this is actually just a line break), and p tags are merely used for formatting.

What I would like to be able to do, is to use css instead of tables throughout the site. Then I could do all the layout and styling directly through css in the style sheet ... assuming this is possible.

So, rather than having a line like this:

echo "<td>{$Title} {$Composer} {$Solo}{$Desc} {$Duration}\n";

the line might look like this:

echo "<div id="title">{$Title}\n";
echo "<div id="composer">{$Composer}\n;

I know the above doesn't work, but it's the only way I can conceptualize it just now, cause I know so little <smiles>:

Thanks for your patience and any pointers.

nascent
Was This Post Helpful? 0
  • +
  • -

#4 supersloth  Icon User is offline

  • serial frotteur - RUDEST MEMBER ON D.I.C.
  • member icon


Reputation: 4517
  • View blog
  • Posts: 28,417
  • Joined: 21-March 01

Re: PHP and CSS

Posted 13 June 2005 - 10:52 AM

i don't see any problem with that, thats how a lot of this very site works.

edit:

the key is, in your tags like <div id="title"> you need to use single quotes so that the echo doesn't end, like so <div id='title'>
Was This Post Helpful? 0
  • +
  • -

#5 skyhawk133  Icon User is offline

  • Head DIC Head
  • member icon

Reputation: 1877
  • View blog
  • Posts: 20,284
  • Joined: 17-March 01

Re: PHP and CSS

Posted 13 June 2005 - 11:04 AM

Check out the resources our members have submitted:

http://resources.dre...?p=links&cat=14

Almost all of the boxes you see on this site including the rows are done using <div> and CSS.
Was This Post Helpful? 0
  • +
  • -

#6 nascent  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 11-June 05

Re: PHP and CSS

Posted 13 June 2005 - 11:45 AM

supersloth, on Jun 13 2005, 10:52 AM, said:

the key is, in your tags like <div id="title"> you need to use single quotes so that the echo doesn't end, like so <div id='title'>

Perfect! <smiles> ... thanks so much.

nascent
Was This Post Helpful? 0
  • +
  • -

#7 nascent  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 11-June 05

Re: PHP and CSS

Posted 13 June 2005 - 11:48 AM

skyhawk133, on Jun 13 2005, 11:04 AM, said:

Check out the resources our members have submitted:

http://resources.dre...?p=links&cat=14

Thanks for intuiting my next question and answering before I posted <smiles>.

I really appreciate all the help. You guys are great!

nascent
Was This Post Helpful? 0
  • +
  • -

#8 cyberscribe  Icon User is offline

  • humble.genius
  • member icon

Reputation: 10
  • View blog
  • Posts: 1,062
  • Joined: 05-May 02

Re: PHP and CSS

Posted 13 June 2005 - 06:18 PM

Reading this post gave me a warm fuzzy glow. Yes, another newbie is learning to use CSS instead of tables. A new generation of greatness emerges.
Was This Post Helpful? 0
  • +
  • -

#9 skyhawk133  Icon User is offline

  • Head DIC Head
  • member icon

Reputation: 1877
  • View blog
  • Posts: 20,284
  • Joined: 17-March 01

Re: PHP and CSS

Posted 13 June 2005 - 06:21 PM

More importantly, us old guys (Josh and I) are both using it now :)
Was This Post Helpful? 0
  • +
  • -

#10 supersloth  Icon User is offline

  • serial frotteur - RUDEST MEMBER ON D.I.C.
  • member icon


Reputation: 4517
  • View blog
  • Posts: 28,417
  • Joined: 21-March 01

Re: PHP and CSS

Posted 13 June 2005 - 09:24 PM

i've always been using it, just not fully. my new site design will be 100% css when i get off my lazy ass though :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1