Stalingrad Posted November 7, 2011 Share Posted November 7, 2011 Hey guys! I've been having a huge problem with CSS. I've tried every way possible. It doesn't even take the CSS coding, I think. Here is the EXACT coding in style.css: banner{ font-size: 30px; font-color: black ;font-family: verdana; } top{ font-size: 8px; font-color: red; font-family: verdana; } body{ font-size: 14px; font-color: blue; font-family: verdana; } Ok I am using this with the index.php for now, just to get things to work, then I will use it for the whole site. Here is index.php: <?php session_start(); include("config.php"); ?> <html><head><title> Hello World </title> <link href="style.css" rel="stylesheet" type="text/css"></head><body> <?php echo "<td class=\"banner\">Welcome!!</banner><br><br><td class=\"top\">Testing this!</top><br><br><td class=\"body\">Testing this again!!</body>";?> </body></html> Now, I will show you the config file: <?php session_start(); include("style.css"); $con = mysql_connect("localhost","username","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("rockefel_db", $con); $showusername = $_SESSION['username']; $usergetquery = mysql_query("SELECT * FROM users WHERE username = '$showusername'"); while($ur = mysql_fetch_array($usergetquery)) { $suserid = $ur['userid']; $susuername = $ur['username']; $scredits = $ur['credits']; $sname = $ur['name']; $sage = $ur['age']; $ssignedup = $ur['signedup']; $slastseen = $ur['lastseen']; $sposts = $ur['posts']; $susertype = $ur['usertype']; $susershop = $ur['usershop']; $smainpet = $ur['mainpet']; $savatarcount = $ur['avatarcount']; $suseravatar = $ur['useravatar']; $sbanned = $ur['banned']; $suserlookup = $ur['userlookup']; } echo "<font face=verdana><font size=4><font color=black>This is a test... displaying...<br><br>$suserid<br>$scredits</font>"; ?> Okay. Can somebody please tell me how to fix this? thanks! Quote Link to comment https://forums.phpfreaks.com/topic/250656-my-css-will-not-work/ Share on other sites More sharing options...
Zane Posted November 7, 2011 Share Posted November 7, 2011 The syntax in CSS for class selectors is .banner .top add the dot and it should be fixed. Quote Link to comment https://forums.phpfreaks.com/topic/250656-my-css-will-not-work/#findComment-1286052 Share on other sites More sharing options...
floridaflatlander Posted November 7, 2011 Share Posted November 7, 2011 Right off hand you don't have any closing table data tags in your echo statement. Also put one of them there dot lookin things in front of that banner word. To make it look like this .banner I don't have any idea what "top" is. If your going to be using verdana in every div you just need to declare it in the body element. Quote Link to comment https://forums.phpfreaks.com/topic/250656-my-css-will-not-work/#findComment-1286054 Share on other sites More sharing options...
Stalingrad Posted November 7, 2011 Author Share Posted November 7, 2011 didn't work Quote Link to comment https://forums.phpfreaks.com/topic/250656-my-css-will-not-work/#findComment-1286060 Share on other sites More sharing options...
floridaflatlander Posted November 7, 2011 Share Posted November 7, 2011 In life you have to work with what you got. Sorry I didn't see this earlier When I mentioned body I didn't pay attention and see a class named body, anyway this works for me. I changed font size and color for a test body { font-family: verdana; } .banner{font-size: 58px; color: #fff;} .top{font-size: 18px; color: red; } .body {font-size: 25px; color: green;} Change font-color to color, font-color is old and not for css Be sure to close your td's. is the path to style.css correct? Quote Link to comment https://forums.phpfreaks.com/topic/250656-my-css-will-not-work/#findComment-1286072 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.