dadamssg Posted January 16, 2009 Share Posted January 16, 2009 I have an image thats a .png file...i think i need to use css to display this....my question is whats the code to put the .png image as my background without getting a syntax expecting ; or ; error. thanks Link to comment https://forums.phpfreaks.com/topic/141022-how-to-incorporate-css-in-php/ Share on other sites More sharing options...
revraz Posted January 16, 2009 Share Posted January 16, 2009 Post your code that generates the error. Link to comment https://forums.phpfreaks.com/topic/141022-how-to-incorporate-css-in-php/#findComment-738115 Share on other sites More sharing options...
evanct Posted January 16, 2009 Share Posted January 16, 2009 You know you can echo html right? like this: echo '<div id="backgroundimagediv"></div>'; and then in the stylesheet set the background-image for #backgroundimagediv. Link to comment https://forums.phpfreaks.com/topic/141022-how-to-incorporate-css-in-php/#findComment-738118 Share on other sites More sharing options...
dadamssg Posted January 16, 2009 Author Share Posted January 16, 2009 i made a site with dreamweaver and this is how it coded it....i tried to just copy paste this segment but got the errors <style type="text/css"> <!-- body { background-color: #780606; background-image: url(stripe_99ac19a4de4dd468b14ca733d92aee38.png); } --> </style> Link to comment https://forums.phpfreaks.com/topic/141022-how-to-incorporate-css-in-php/#findComment-738120 Share on other sites More sharing options...
dadamssg Posted January 16, 2009 Author Share Posted January 16, 2009 im not familiar with css AT ALL so i don't know how to set anything in any kind of sheet.... Link to comment https://forums.phpfreaks.com/topic/141022-how-to-incorporate-css-in-php/#findComment-738122 Share on other sites More sharing options...
machupicchu Posted January 16, 2009 Share Posted January 16, 2009 <html> <title>sample</title> <head> <link rel="stylesheet" type="text/css" href="mystyle.css" /> </head> <body> <?php // you php code goes here ?> </body> </html> where mystyle.css is the name and location to your style sheet you mentioned. read up on external style sheets overhere: http://www.w3schools.com/CSS/css_howto.asp Link to comment https://forums.phpfreaks.com/topic/141022-how-to-incorporate-css-in-php/#findComment-738127 Share on other sites More sharing options...
Redlightpacket Posted January 16, 2009 Share Posted January 16, 2009 try this and see if it works <?PHP echo'<style type="';echo'text/css';echo'"> <!-- body { background-color: #780606; background-image: url(example.png); } --> </style>'; ?> Link to comment https://forums.phpfreaks.com/topic/141022-how-to-incorporate-css-in-php/#findComment-738132 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.